LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to give an indicator a value from a external file / variable?

Hi,

 

i'm using an Event Structure that should execute if the Control X is changed.

This X lies in a case structure; if only i press this X Control, die event structure is executed, this works fine.

 

Now, i want to make this indicator depending on an external file - the indicator should change and execute if a variable in the vi is changed,....

 

However, i don't succeed. Even if i change the Indicator to a Control and add another indicator to this: clearly the control is changed (numeric output, if i press the control), but my event structure doesn't respond to it!

 

I might be completly wrong, plz give me advice,....

Thx!

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

Hi Max,

 

you talk about a control "X", then you "want to make this indicator" start an event. What is it?

 

You can force events by writing to a "Value (signalling)" property node of a control...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(2,949 Views)

Hi, thanks for your reply.

 

I was kind of... difficult to understand.

 

Checkt he following example; as soon as the "numeric" field is set by a variable, die execute loop doesn't respond to it!
Only if i would enter as user directly into field "numeric".

 

That's it!!!

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

Hi max,

 

sorry, cannot open LV2011 VIs so far...

 

As said before: the event structure will only respond to "real" events (like user input). Writing a value to an indicator will not cause an event! To force an event you have to use a "value (signalling)" property node of the control (instead of a local variable)!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(2,941 Views)

For Gerd,

 

Here is a snippet.

 

 

 

Writing from a control to a local variable of itself serves no purpose.  So there is no reason for the bit of code outside the loop.  Inside the loop, you'd be better off reading from the control's terminal rather than a local variable of it.

 

Now it's not clear from your description what event you are really trying to trigger.  The numeric value change case will never run.  Because the numeric control is an indicator, the user can never change it.  And because you aren't using a Value Signalling property node to write to it, the even is never programmatically fired either.   Thus the Event Source 2 Val(sign) property node is never written to in that case.

 

Be careful about how you use value signalling property nodes when they are in the same loop as the event case.  You could quickly cause cascading actions that could fill up the event queue.  The while loop can only execute the event structure once.  But if on every iteration of the loop you wind up queueing up multiple events, you'll quickly fall behind and fill up the event queue because it can't handle the events as quickly as you are generating them.

0 Kudos
Message 5 of 5
(2,936 Views)