LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event - value change, not triggered by indicator

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 runs

I 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?


0 Kudos
Message 1 of 6
(7,085 Views)
The return count is the desired event trigger for variable change
0 Kudos
Message 2 of 6
(7,083 Views)
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 Smiley Wink)... 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
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 6
(7,080 Views)
Thank you, the value.signaling node was the key


How do you thank people individually in this forum?


0 Kudos
Message 4 of 6
(7,072 Views)


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.
Message 5 of 6
(7,066 Views)

"crewex" <x@no.email> wrote in message
news:1218562809880-761067@exchange.ni.com...
> 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.


Message 6 of 6
(7,019 Views)