LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Restart VISA timeout as data comes in

I am reading continous (ASCII) serial data from an external device. We setup the VISA port with a decent timeout, and with CR as the termination character.

We then sit in a loop and read our text lines as they come in.

 

It appears that the timeout does not reset back to its start value after we service each read, so after a few lines we timeout.

 

How do we reset the timeout within our loop? I have tried setting the timeout using VISA Set Timeout within our loop, but that does not seem to reinitialise the timeout time. Do we have to close and reopen the port to force a timeout reset?

 

Setting a hugely long timeout meansn that if our data hangs we will have to wait a long time to notice, which is not acceptable.

 

0 Kudos
Message 1 of 3
(2,776 Views)

The timeout is most certainly resetting.

 

If you think it isn't, then something else must be going on.  Please post your code.

0 Kudos
Message 2 of 3
(2,775 Views)

Is the external device sending the CR?  There have been similar timeout issues which have been caused by this.


Regards,

Peter D

0 Kudos
Message 3 of 3
(2,759 Views)