Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

preventing conflict between event trig and polled i/o access

Hi,

I have one or buttons that when depressed, cause a serial port message to be sent. When a key has not been depressed, I want to send a query and read a response. I am considering two ways to do this;

#1. Have an event with a timeout. On timeout I query and read a response. Otherwise, when a button is depressed, I send a "command".

#2. Have an event with NO timeout but have a parallel execution thread thats always writing and reading on a timed basis.


Method #1 seems the most intuitive to me to prevent conflict (only 1 thing can be done at a time, either send the command or poll).

But I am wondering what would happen if method #2 was implemented. Is there a way to "block" the push button if the poll path is taken. Obviously I wouldn't want to start a poll and then have the push button interrupt the poll-response.
0 Kudos
Message 1 of 2
(2,537 Views)
Hi,

I would deffinately choose method #1, but you ask if there is a way to "block" the push button if the poll path is taken? The answer is, Yes. You can create a property node for the push button and select the 'Disabled' property, and wire either a 1(disable) or a 2(disabled and grayed out) to it, when you enter the poll path and create another property node for the same push button and wire a 0(enable) to it when exiting the poll path to re-enable the control.
Message 2 of 2
(2,528 Views)