Hi,
I have RS232 connection to a device and I used the SerialPort Wrapper in C#. I am able to establish connection and be able to access registers. What I need is to continuously monitor the connection and automatically indicate disconnect(button) in GUI whenever there is a reset on the hardware. The reset on the hardware doesnot affect the USB ports or voltage on the RS232 lines. The USB ports are all the time available. I implemented connection polling by reading a scratch register with a timer.
I am using IsOpen function and perform RS232 read to a register now and if I get the response, I proceed with the connection. Whenever the poll connection checkbox is selected, I start a timer and start the same above read continuously. Though this works, whenever i try to do a block read (starting from a particular address read 'n' datawords, just while the read starts the timer expires and i get disconnected. Also, this read value also gets added to my readblock values.
But I am not sure of the best way to implement the connection polling. I am not using the DataReceived Handler in my code, because I do read/write operations linear fashion. Please give a suggestion. Thanks,Venkat