LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

programmatically setting a Boolean switch so that an event handler will act on it.

Solved!
Go to solution

Hello,

 

Is there a way to programmatically set a Boolean switch so that an event handler will act on it? I am using a GUI developed by another group, with producer/consumer structure, as part of a hardware validation. I want to create a separate vi that will control the GUI. Currently I can set the Boolean controls using an invoke node but the event handler does not react to them. My suspicion is that it is mechanical action of the Booleans. Is there a way to do this with out changing the mechanical action?

 

Pat

0 Kudos
Message 1 of 6
(4,413 Views)

Write to a signaling value property node (Val(Sgnl)).

 

Make sure to use value change events and not some other misguided thing like e.g. "mouse down", for example.

 


@PatM23 wrote:

Currently I can set the Boolean controls using an invoke node but the event handler does not react to them. 


How exactly were you setting a value with an invoke node. Are you sure you are not using a value property node?

 


@PatM23 wrote:

My suspicion is that it is mechanical action of the Booleans. Is there a way to do this with out changing the mechanical action?


I would stay away from suspicions that can easily be tested and proven wrong (change mechanical action for a few seconds and see if it makes a difference ;))

 

Message 2 of 6
(4,411 Views)

what is the mechanical action of the switch/latch? at what value of the switch/latch do you want this event to happen?

0 Kudos
Message 3 of 6
(4,394 Views)

I am opening a reference to the VI I want to control and then using the method/control value/set variant setting of an invoke node.

 

I did find some labview documentation that states you can't use the signaling value property node on switches set to latch. Unfortunately I can't change the VI I am trying to control.

0 Kudos
Message 4 of 6
(4,357 Views)
Solution
Accepted by PatM23

Well, a switch is typically switch action (thus the name!). You never said you are trying to use latch action booleans. 😄

 

Yes, local variables and value properties cannot be used for latch action booleans because they are reset to the default state when the terminal is read by the code, and if you would allow them to be read and set in multiple places, you'll generate a giant mess.

 

 

0 Kudos
Message 5 of 6
(4,350 Views)

maybe this is one way of getting away with a latch....

 

Spoiler
latch action signaling_BD.png

 

0 Kudos
Message 6 of 6
(4,344 Views)