Discussion:
Event - value change, not triggered by indicator
(too old to reply)
crewex
2008-08-12 17:10:08 UTC
Permalink
I have a sub vi that is supposed to detect when a new com port becomes active, however it is not supposed to run everytime, only when the number of com  ports change. That part is figured out.I am using an event structure to determine when it runsI desire the event to be run when length of the com port name array changes (i.e. when a new device is added, or removed).  I attached a value change event to the array that list all the com ports (visa find output)However, from what I can tell, events are only triggered by controls(inputs), not by indicators(outputs)Anybody know why? or how to make it work in this fashion?Addendum: Can the event be inside of the sub VI or does it have to be in the VI?


visa probe ports (SubVI).vi:
http://forums.ni.com/attachments/ni/170/348722/1/visa probe ports (SubVI).vi
crewex
2008-08-12 17:10:09 UTC
Permalink
The return count is the desired event trigger for variable change
GerdW
2008-08-12 17:40:08 UTC
Permalink
Hi crewex,the attached vi doesn't has any event structure on the block diagram... So what are you talking about?Only controls can trigger events. Indicators are controlled by the vi: you already know what happens, so there is no reason to trigger an event (in general :smileywink:)... And events are NOT triggered by writing to a terminal or to a local variable!But: you can force an event by writing to a "value.signaling" property node of a control! Or you create a user defined event...Message Edited by GerdW on 08-12-2008 07:21 PM
crewex
2008-08-12 17:40:09 UTC
Permalink
Thank you, the value.signaling node was the key How do you thank people individually in this forum?
altenbach
2008-08-12 18:10:05 UTC
Permalink
crewex wrote:Thank you, the value.signaling node was the key


The behavior is also different in that the event will trigger with every value(sgnl) call, even if the new value is the same asn the old.
 
It seems you only want to trigger the event if the result is different to the previous result. Easiest would be to use a shift register, compare old and new, and place the code in a case structure that only runs the relevant code if new and old differ (no event structure needed).
If you still want to use an event structure, place a case structure inside it, compare old and new from the event terminal, and execute the empty frame if they are the same.
Wiebe@CARYA
2008-08-15 15:16:22 UTC
Permalink
Post by crewex
How do you thank people individually in this forum?
If you want to thank Crewex, just say "thank you, Crewex".

You can rate the post you like. Allthough having a 5 star rating isn't
cashable, it's the best you can do...

I think you can send private messages, but please don't do that just to
thank someone.

Regards,

Wiebe.

Continue reading on narkive:
Loading...