Serial Port interfacing

G

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
 
F

Floyd Burger

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

Kevin said:
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!lol
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:)
 
T

The Real Andy

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).

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.
 
K

Kevin P. Fleming

The said:
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

Searching on GotDotNet (and Google) didn't turn up any hits for that...
can you provide a link? Thanks.
 
A

Alex Moskalyuk

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



Kevin said:
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!lol
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:)
 
G

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



Kevin said:
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
 
Joined
Jul 29, 2018
Messages
2
Reaction score
0
Floyd Burger

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
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Top