LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

get the new value from an event structure block

Hello!
 
I'm using an event structure block. I've edited an event wich its event sources are an indicator an a variable (a real matrix). I want to get (to catch) the new value of the indicator and the variable from the frame placed at the left top, but the new value attribute is not a real not an integer.....is variant type. I have no idea what i have to do to catch this two values from here. Someone can post a simple example about it?
 
Thanks in advance!
Regards
 
Larson 
0 Kudos
Message 1 of 4
(2,725 Views)
SInce one item is a scalar and the other an array, you cannot get the value directly. They have a different data type.
 
While there are direct solutions using the variant tools, easiest would be to place the terminals of the two controls inside the event case and read them directly instead of using the NewVal terminal. Is there a reason you don't want to do that?
 
 
0 Kudos
Message 2 of 4
(2,712 Views)

I'd read that it's better to use the new value from the event block......because getting the valur directly from the terminal you could obtain the old value. Do you think it will work correctly using the terminal instead of the new value from event block?

 

Thanks

Larson

0 Kudos
Message 3 of 4
(2,705 Views)
If the terminal is INSIDE the event structure, you'll always get the new value. It will NOT be read until the event case executes, at which point the terminal contains the new value. (If the terminal is outside the event structure, and the wire goes inside the event structure, you'll get a stale value when the event for that terminal triggers. This is expected from the dataflow.)
 
Put the terminals inside the proper event case, you'll be fine! 🙂
Message 4 of 4
(2,698 Views)