Serial Port interfacing

Discussion in 'Microsoft C# .NET' started by Guest, May 4, 2004.

  1. Guest

    Guest Guest

    Hi all

    I am having a problem reading from a serial port, first of all I have now resorted to using the MSComm ActiveX control on my Windows Forms to provide me with the interface to my serial port. is there no other way to do this - it has to be simple or well explained because I'm still new to the .NET world and c#. I did stumble across an article on the MSDN site where I downloaded a file NetSerialComm.exe - I think it was from one of the msdn magazines? But anyway I don't know what the heck is going on here! there are so many classes, I don't know which ones to instantiate or if I'm supposed to write my own classes derived from these?! I would just like something simple that would give me the capabilities of reading and writing to a comport. I know that for reading a port is alot harder than writing to one because you're not really in control, you basically have to do it on an Event basis - but I don't know how to construct me form/class to raise an event when data is coming through the port

    Plainly put, that is why I resorted to the MSComm.ocx. But now when I set my Card reader up and I plug it in and I swipe my transponder card the OnComm event of the Active X control executes 3 times and I get 3 sections of the number thats on the card! - where as in Hyperterminal I get 1 long string. I have no Idea why the event would be raised 3 times? any suggestions?

    I would like to break away from the MSComm control purely because I want a .NET component, but this product I want to make will be sold so I am screwed by open source liscence agreements!lo

    Please can someone give me some help or point me in a direction where I can find this sort of stuff explained in plain english:

    Thanks
    Kevin
     
    Guest, May 4, 2004
    #1
    Shinesylvester22 likes this.
    1. Advertisements

  2. Guest

    Floyd Burger Guest

    TransPort from www.componentscience.net, it's a commercial serial
    communications library. I saw them at a conference last year, and they had
    a card reader set up for their demo. They use regex for data matching, so
    you can set up a packet for the data coming from your card and it will come
    in at once instead of spreading over a few events. When I was talking with
    them, they seemed very knowledgeable and willing to help, so they can
    probably offer some guidance (probably more if you buy their product<g>)
    BTW, the reason why you're getting multiple events is that's how the data
    is coming in and being fed by the port driver. It's usually in 8 byte
    chunks (give or take depending on how fast the app can process data and how
    fast the port drivers can handle the data).

    --
    Floyd Burger

    resorted to using the MSComm ActiveX control on my Windows Forms to provide
    me with the interface to my serial port. is there no other way to do this -
    it has to be simple or well explained because I'm still new to the .NET
    world and c#. I did stumble across an article on the MSDN site where I
    downloaded a file NetSerialComm.exe - I think it was from one of the msdn
    magazines? But anyway I don't know what the heck is going on here! there are
    so many classes, I don't know which ones to instantiate or if I'm supposed
    to write my own classes derived from these?! I would just like something
    simple that would give me the capabilities of reading and writing to a
    comport. I know that for reading a port is alot harder than writing to one
    because you're not really in control, you basically have to do it on an
    Event basis - but I don't know how to construct me form/class to raise an
    event when data is coming through the port.
    my Card reader up and I plug it in and I swipe my transponder card the
    OnComm event of the Active X control executes 3 times and I get 3 sections
    of the number thats on the card! - where as in Hyperterminal I get 1 long
    string. I have no Idea why the event would be raised 3 times? any
    suggestions?
    ..NET component, but this product I want to make will be sold so I am screwed
    by open source liscence agreements!lol
    can find this sort of stuff explained in plain english:)
     
    Floyd Burger, May 4, 2004
    #2
    1. Advertisements

  3. I use the BaseComm class provided by GotDotNet. I heard a rumour that
    this will be similar to the class that MS is supposed to be providing
    in the future. Using the line term class is very similay to using
    MSComm

    To date, I've had it running in several industrial environments and I
    have not yet had a drama.
     
    The Real Andy, May 4, 2004
    #3
  4. Searching on GotDotNet (and Google) didn't turn up any hits for that...
    can you provide a link? Thanks.
     
    Kevin P. Fleming, May 4, 2004
    #4
  5. Guest

    Floyd Burger Guest

  6. I've used the library from GotDotNet
    http://www.gotdotnet.com/Community/...mpleGuid=9dde5cf3-4842-4d4b-baa7-73e09c4d5890
    for my applications.

    With the exception of few bugs and some error handling the library seems to
    work fine.

    Alex Moskalyuk
    _________________________________
    http://www.techinterviews.com



    resorted to using the MSComm ActiveX control on my Windows Forms to provide
    me with the interface to my serial port. is there no other way to do this -
    it has to be simple or well explained because I'm still new to the .NET
    world and c#. I did stumble across an article on the MSDN site where I
    downloaded a file NetSerialComm.exe - I think it was from one of the msdn
    magazines? But anyway I don't know what the heck is going on here! there are
    so many classes, I don't know which ones to instantiate or if I'm supposed
    to write my own classes derived from these?! I would just like something
    simple that would give me the capabilities of reading and writing to a
    comport. I know that for reading a port is alot harder than writing to one
    because you're not really in control, you basically have to do it on an
    Event basis - but I don't know how to construct me form/class to raise an
    event when data is coming through the port.
    my Card reader up and I plug it in and I swipe my transponder card the
    OnComm event of the Active X control executes 3 times and I get 3 sections
    of the number thats on the card! - where as in Hyperterminal I get 1 long
    string. I have no Idea why the event would be raised 3 times? any
    suggestions?
    ..NET component, but this product I want to make will be sold so I am screwed
    by open source liscence agreements!lol
    can find this sort of stuff explained in plain english:)
     
    Alex Moskalyuk, May 4, 2004
    #6
  7. Guest

    Guest Guest

    Hi Alex

    How do I actually use these classes in my application? I somehow think I need to create my own classes that derive from these, but what do I need to do, and which ones do I derive from!

    Thanks for any help, and thanks to all you other guys for all your inpu

    Kevi

    ----- Alex Moskalyuk wrote: ----

    I've used the library from GotDotNe
    http://www.gotdotnet.com/Community/...ampleGuid=9dde5cf3-4842-4d4b-baa7-73e09c4d589
    for my applications

    With the exception of few bugs and some error handling the library seems t
    work fine

    Alex Moskalyu
    ________________________________
    http://www.techinterviews.co



    resorted to using the MSComm ActiveX control on my Windows Forms to provid
    me with the interface to my serial port. is there no other way to do this
    it has to be simple or well explained because I'm still new to the .NE
    world and c#. I did stumble across an article on the MSDN site where
    downloaded a file NetSerialComm.exe - I think it was from one of the msd
    magazines? But anyway I don't know what the heck is going on here! there ar
    so many classes, I don't know which ones to instantiate or if I'm suppose
    to write my own classes derived from these?! I would just like somethin
    simple that would give me the capabilities of reading and writing to
    comport. I know that for reading a port is alot harder than writing to on
    because you're not really in control, you basically have to do it on a
    Event basis - but I don't know how to construct me form/class to raise a
    event when data is coming through the portmy Card reader up and I plug it in and I swipe my transponder card th
    OnComm event of the Active X control executes 3 times and I get 3 section
    of the number thats on the card! - where as in Hyperterminal I get 1 lon
    string. I have no Idea why the event would be raised 3 times? an
    suggestions..NET component, but this product I want to make will be sold so I am screwe
    by open source liscence agreements!lo
     
    Guest, May 5, 2004
    #7
  8. The Real Andy, May 5, 2004
    #8
  9. Guest

    39Yellow

    Joined:
    Jul 29, 2018
    Likes Received:
    0
    Dear Mr. Burger,
    I'm looking for programming guide for Transport library from Componentscience. But found nothing from web at this point. I am not sure if you can help me out for such a rude inquiry.
    Thanks in advance.
    CS
     
    39Yellow, Jul 29, 2018
    #9
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.