LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

event structure doesn't register local vars

Solved!
Go to solution

I have a gif of a basic FPGA topology that I want to show some loopbacks in.  As the user clicks on the booleans, vertical lines should appear, then disappear as they click them again, showing the current loopback topology.

 

To conserve resources, I opted to use an event structure.  So far I have set it up for the RX_FAC and RX_TERMXCO4AU loopbacks that you see in the upper left of the picture.

 

Only one RX loopback and one TX loopback can be on at a time, so one of the first things that happens when the user clicks the boolean is that it sets the values of all the other booleans in that row to false, via the use of local variables.

 

The problem is - the event structure only executes when the user actually clicks the boolean true or false, but not if the boolean is set false via the use of a local var.  In other words, let's say I have RX_TERMXCO4AU true, and RX_FAC false.  If I click RX_FAC to set it true, then you'll notice RX_TERMXCO4AU goes dark/false, and RX_FAC lights up.  So the value of RX_TERMXCO4AU changed, but the event structure associated with RX_TERMXCO4AU did not execute (which is why the vertical line between RX_TERMXCO4AU and TX_FACXCO4AU stays there).

 

This will make a lot more sense if you run the attached simple VI.  Right now, events only exist for RX_FAC and RX_TERMXCO4AU, but it's sufficient to explain the problem I think.

 

Any help is appreciated.

0 Kudos
Message 1 of 5
(2,335 Views)

You should use 'Value (Signaling)' property node, wherever you're updating any control/indicator using local variabl and want it to be registered by EVENT STRUCTURE.

 

Value Signalling.png


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


Message 2 of 5
(2,332 Views)
Solution
Accepted by topic author bmishoe

The event structure is for user generated events.  Writing to a local variable is a programmatic change.

 

What you want to do is write your value to the Value(Signalling) property of the boolean which will change the value and fire the value change event.

0 Kudos
Message 3 of 5
(2,330 Views)

This worked!  I learned something new today...

 

Thank you very much!

0 Kudos
Message 4 of 5
(2,327 Views)

@bmishoe wrote:

I learned something new today...


One more thing you can learn, When you are passing an array input to a For loop with 'Auto indexing' enabled, you need not wire anything to For loop's 'N' terminal.

In other words:
If you enable auto-indexing on an array wired to a For Loop, LabVIEW sets the count terminal so you do not need to wire the count terminal. 

 

Auto indexed enabledFor Loop.png

In your code, you can remove the 'Array Size' nodes.

 

Auto indexed For Loop.png


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


Message 5 of 5
(2,317 Views)