LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial data timeout

Hello,

I keep getting the error below from my serial read VI.  I would like to use serial read to read data from a serial connection.  I believe I am getting the error because the serial device does not send data in regular periods but based on user input from the serial device.  Serial data comes to Labview at random intervals.  How do I keep the serial port open so that I can read the data from the serial device and not get this error?  The termination for the serial data is <ETX>.  I don't believe I can use that as a termination character.  I am thinking to just use the error clear VI but I was wondering if there was a better route.

Thank you!

 

 

VISA: (Hex 0xBFFF0015) Timeout expired before operation completed.

0 Kudos
Message 1 of 5
(388 Views)

I suggest you watch this video: VIWeek 2020/Proper way to communicate over serial

 

BTW: ETX is 0x03

========================
=== Engineer Ambiguously ===
========================
Message 2 of 5
(375 Views)

You can specify the termination character with the VISA Configure Serial Port VI (in your case, <ETX> is simply 0x03). 

But that aside, you may want to consider this example to read serial data instead.


https://forums.ni.com/t5/LabVIEW/Communication-with-serial-device/m-p/3791957#M1069773

 
Regards,
Paulo
CLA, CTD
Aurum Automation Inc.

CLACTD
0 Kudos
Message 3 of 5
(318 Views)

I updated your VI to show how I handle intermittent communication. I use the Bytes At Port to see if a message has started to come in. I do not use it to determine how many bytes to read, just to see if there is data to read. If there is data, read it. If no data, use a wait. I tend to used a 50ms wait for these situations.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 5
(265 Views)

Thank you! I actually watched the video and created this exact VI.  You have all been very helpful 

0 Kudos
Message 5 of 5
(241 Views)