Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best way to Read RS232 for a long period of time, using VISA?

What is the best solution to read RS232 if I don't know wend information is send from device to PC? I have a VI that works fine, but if I don't  have any data on serial port I have this error mesage:

 

"Error -1073807339 occurred at VISA Read in data matrix serial_mod.vi
Possible reason(s):
VISA:  (Hex 0xBFFF0015) Timeout expired before operation completed.."

 

My VI must work all day and when I receive something on RS232, the VI must  to work properly.

Thanks you.

0 Kudos
Message 1 of 4
(3,076 Views)

Hi

Before starting the read you can use the property bytes at serial port to check if any data is avalable.

If you do that each 100ms or more often when needed you won't miss data and neverhave a timeout on read.

greetings from the Netherlands
0 Kudos
Message 2 of 4
(3,075 Views)

Do you mean the  "number of bytes at serial port" ? because I don't find "property bytes at serial port".

Thank  you.

0 Kudos
Message 3 of 4
(3,073 Views)

indeed, sorry for the renaming

greetings from the Netherlands
0 Kudos
Message 4 of 4
(3,071 Views)