06-29-2007 02:05 AM
07-02-2007 01:02 AM
Hi Kai,
If you setup and code your application correctly, that is an half-hour project to read constant number of bytes from a periodic data feed.
Just call the ComRd function (with the port number your data array and packet size (128 in your case) as input) in a loop.
Of course, you have to open the COM port first using OpenComConfig function, where you can specify the communication parameters like baud rate, number of data bits, parity, etc.
Hope this helps.
07-02-2007 08:06 AM
07-18-2007 05:08 AM
Thanks to both of you!
I finally had some time for this little project. After using standard COM I played around a little and ended up using the VISA drivers/functions, as i got them working correctly first. I guess some setting issues of my COM port. Anyway, I can reliable read my RS422.
I´d appreciate if somebody could give me hints on the remaining issues:
- To read 128byte every 5ms I got a 5ms timer. The read/display (i just put it in a textbox) is done in the timer callback function. This way my userinterface gets unuseable. (I can´t even click "exit"). Any hints on how to overcome this problem?
- there seems to be a minimum limit to the size of the readbuffer handed to viRead (i used it on two different systems (WinME and WinXP) where the limits were 512byte / 2000byte) I only want to read 128 byte at a time only so i would prefer to keep the buffer small. Any workarounds? I didn´t even find the limit in my documentation.
Ciao
Kai
07-18-2007 06:11 AM