From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to avoid serial port timeout

I am working with a device which may run for hours, so I don't want to have timeout error. What should I do to disable the timeout function on VISA Configure Serial Port?

 

Thanks.

Angelia

0 Kudos
Message 1 of 2
(6,423 Views)

Timeouts can be avoid by closing the port when you are not using it and only opening when you want to talk.

 

But if you want to monitor the port data you should either increase the frequncy at which you read the data waiting in the input buffer OR

 

Bump-up the recieve buffer size to hold more between your checks.

 

Now if you want to really disable the thime outs you could set the TO to something very large or you can check for the appropriate error code and just ignore that error.  Warning: I do not recomend either of the two options since a long TO value will result in a hang if you try to abort while it is waiting or, you will get no clue as to what is happening when the cord to the widget gets kicked loose.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 2
(6,420 Views)