LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Will local variable get update in an event?

Hi,
 
I have an event strucure that gets called by buttons on the front panel. I have local variables in one case that I want updated in another case that gets called later.  It seems like the local variables in the second case are not getting updated. 
 
I realize you can't use a local variable to call the event. 
 
0 Kudos
Message 1 of 5
(3,081 Views)
Only things in the case that actually executes will update. If you need something to update independent of the event case, you need to place that code outside the event structure. Don't overuse local variables, they are rarely needed. Please attach your VI so we can make suggestions.
 
Yes, local variables won't trigger an event, this is by design. If you need to trigger an event programmatically, you can write to a signaling proerty (Value(sgl)) of the control.
0 Kudos
Message 2 of 5
(3,077 Views)

Thanks for your response.  I went through and removed almost all my lv and it seemed to help.  I'm still having problems figuring out how to get variables that change in one event into to another event.  I'm not sure about posting my software.  There are some security concerns and I will have to think about it. 

Do you have a suggestion for getting data from one event to another? Also is it possible to trigger an event from a text ring?

0 Kudos
Message 3 of 5
(3,059 Views)
As Altenbach already said, you can always trigger an event programmatically writing to the signaling property (Value(sgl)) of any control/indicator, even in an event handler.
To pass data between different event cases, you can use shift registers or the new control value as shown in my example vi (7.0).
You could use a dedicated, hidden control to trigger an event where you operate differently depending on the control's new value.


Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 5
(3,044 Views)
Very Helpful thank you very much!
0 Kudos
Message 5 of 5
(2,998 Views)