maverick_majnoo

Hi,

I have a device which is based over serial ports, i have written a piece of code, in which i can send a command to this device and receive the data in response of that command, and it works fine.

Now, my problem is this device pushes data IN, at random intervals, actually it's a Radio freq. based machine, and it receives msgs from other stations with similar kind of machines, so at any time....the console in my program shows

$ RX STATUS

This is a trial message......

MEssage ending.......

RX Status ACK

my problem is how do i know that a message is getting received, and when it got received i had to fill up a list showing the msgs...received successfully.....

is there an even which can tell me, when datareceiving is stopped.....

Regards

Brij



Re: Common Language Runtime Serial port based device pushing data, how to know when data receiving is stopped

Alois

Do you use the .NET Framework 2.0 If yes you can use the System.IO.Ports.SerialPort class to receive data and hook ontoe the SerialPort.DataReceived event.

Yours,
Alois Kraus





Re: Common Language Runtime Serial port based device pushing data, how to know when data receiving is stopped

maverick_majnoo

i know how to plug the receiving event...but is there an event to tell me when the line is silent....that means data transmission is stopped, and now i can iterate through this string, and do something with this data....

regards

brij





Re: Common Language Runtime Serial port based device pushing data, how to know when data receiving is stopped

Alois

To know when the data is complete depends on the protocol your device is working. Once the connection is established you can send and receive messages which start and end are device dependant. The message itself should have a this is a complete message of station x tag to signal a complete data packet.

Yours,
Alois Kraus





Re: Common Language Runtime Serial port based device pushing data, how to know when data receiving is stopped

nobugz

Most commonly, serial port devices send a "packets" of a fixed length or including a byte that indicates the length. Or they use a special byte to indicate End-Of-Message. Look for some control character, line-feed (0x10) is most popular.