12-30-2008 10:44 AM
I'm using VISA Wait on Event, serial character, to wait for serial data to arrive. The data arrives once per minute. I have the timeout set for 70 seconds so that the program won't do any reads until the one minute data arrives. If I want to stop the program I have to wait for the message to arrive because the program is "stalled " at the wait on event function. How can I interrupt the wait on event?? The problem I see is that while it's waiting nothing is read. So no booleans are read. I have a feeling I might have to accept this flaw in the event function. All advice is appreciated. Thanks.
ssmith
Solved! Go to Solution.
12-30-2008 10:50 AM
I think it's not possible to break waiting on event. This was my problem too. If you will use another library ( lvserial.dll ), there it's possible by using Flush Buffer funktion, but not in VISA.
You can set your Timeout value e.g. to 1 second, and if timeout happens do nothing (switch case).
12-30-2008 11:28 AM
12-30-2008 11:33 AM
The best choice is:
if you use ASCII protokoll with Termination Carachter(s)
if you use binary protokoll, than you have to know how many bytes to read (package length) and connect this to bytes to read input of the VISA read VI.
12-30-2008 12:33 PM
12-30-2008 12:51 PM
12-30-2008 12:56 PM
12-30-2008 05:06 PM
I personnaly never use the solution from Dennis. So I find this solution not good (or only partitionally good). It may work good for a generally terminal programm (to show received data to user), but if you want to work with a device and have to react as soon as possible and right, the suggestion has some disadvantages.
Eugen
12-30-2008 08:59 PM
Eugen--
In this case it's fine. I'm simply monitoring a com port and when data comes in I write it to a file. If the message is not the expected length I write it to an error file. No interaction required. Thanks.
ssmith