LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading the Visa port in Event Structures

I have my Visa Read and Write Access in multiple Event Structures under a while loop. I write and read different messages with some events. I send a message and expect a certain response back from the EUT. But I can also turn on errors in the EUT to get an error message at any time,not related to any event.  How can I parse the Visa Read buffer to look for error messages without any event taking place? How do you know if there is data in the read buffer? Are the Visa Ports correct to be in the Event Structure? Any Examples?

 

Thanks

 

 

 

 

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

What I have done is use a second loop to constantly read the serial port.  This loop can parse the data and then send the data up to the other loop using User Events, Notifiers, or even queues.  This really only works if you have a good definition of the transmission inclusing sync byte, command ID, and command data format.


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 2 of 3
(2,636 Views)

@Roadrunna wrote:

... in multiple Event Structures under a while loop.

 


I am not familiar with that design pattern and it sounds silly. (Why multiple events? Where is "under"??) Can you show your code?

 

Why don't you poll the port in the timeout event?

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