G
Guest
Hello everyone,
Please forgive me for my ignorance or lack of understanding on the following
technology, as I am by no means an expert in serial IO.
I am writing an application that communicates to a custom hardware device
that requires a 4 byte message to be sent every 500ms to keep it alive.
I have used VB6 to create a prototype application that works fine (using the
MSComm activex control) to send the 4 bytes of data at a 500ms timer interval.
when trying to port it into VS2005 C# leveraging the SerialPort Class, usign
all of the same port properties, it does not work..
so what I did is get a port sniffer and ran it on the vb6 app and notice
that the data is sent at regular intervals(500ms), when running it with the
VS2005 C# version it seems to buffer all writes then release them all at
once(I thought it may be because of the write buffer)so I tried changing the
Write Buffer to be smaller, no luck.
I think what I need to do is perform async writes(to get the non buffered
output) will that get rid of the lag? and is that even possible with the
SerialPort Class?
I notice a flush() method in the base stream property, but it does not seem
to do anything to help it..
I have searched all over the net for samples, and dont find anything that
addresses this effect.
any Suggestions or samples (to provide realtime/non-buffered output to the
serial port) would be greatly apreciated...going on 2 days now...arg
Please forgive me for my ignorance or lack of understanding on the following
technology, as I am by no means an expert in serial IO.
I am writing an application that communicates to a custom hardware device
that requires a 4 byte message to be sent every 500ms to keep it alive.
I have used VB6 to create a prototype application that works fine (using the
MSComm activex control) to send the 4 bytes of data at a 500ms timer interval.
when trying to port it into VS2005 C# leveraging the SerialPort Class, usign
all of the same port properties, it does not work..
so what I did is get a port sniffer and ran it on the vb6 app and notice
that the data is sent at regular intervals(500ms), when running it with the
VS2005 C# version it seems to buffer all writes then release them all at
once(I thought it may be because of the write buffer)so I tried changing the
Write Buffer to be smaller, no luck.
I think what I need to do is perform async writes(to get the non buffered
output) will that get rid of the lag? and is that even possible with the
SerialPort Class?
I notice a flush() method in the base stream property, but it does not seem
to do anything to help it..
I have searched all over the net for samples, and dont find anything that
addresses this effect.
any Suggestions or samples (to provide realtime/non-buffered output to the
serial port) would be greatly apreciated...going on 2 days now...arg