LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa serial remove timeout or increase to very large value

Highlighted

I am using Visa configure serial port, then read and write visa.

System works for upto 1 month for serial read and write independently. 

 

Issue is port is opened for that time and sometimes data may not come upto 7 days.

So there may happen that timeout can happen if no byte read or write in that timeout.

 

So there may happen that timeout happen in Visa configure serial port.

So whats the workaround that timeout do not happen. One thing is that increase timeout value to miiliseconds equiavalent to 7 days,

ANy other option?

0 Kudos
Message 1 of 3
(165 Views)
Highlighted

You don't want to use such a ridiculously long timeout, even if it is possible to set it that long.

What happens if you need to end your program for some other reason?  Your code will be stuck for 7 days waiting for that VISA function to finally time out.

 

The solution is to allow it to timeout.  Then handle that error.  Since a timeout is an expected part of your application, just clear the error and loop back to try again.

0 Kudos
Message 2 of 3
(129 Views)
Highlighted

@Vindhyachal.Takniki wrote:

Issue is port is opened for that time and sometimes data may not come upto 7 days.

So there may happen that timeout can happen if no byte read or write in that timeout.


If it is unknown if data is coming, then I recommend using the Bytes At Port property node to just see if there is data available (Bytes At Port > 0).  If there is, do a read.  If not, perform a short wait.  Do not use the Bytes At Port to tell the VISA Read how many bytes to read, just to see if there is data available.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 3 of 3
(110 Views)