LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with cluster in VI and SubVi

Hello

my problem regards the value change of the cluster in a SubVi.

The subvi contents a event structure that is waiting for an value change of one of the numeric cluster elements.
When i change an value of the cluster in the top-vi the value in the subvi does not change and this results to no output because the event structure does not register a value change. Only if i stop and restart the vi the value of the cluster in the subvi changes. But this ist not an event for the event structure.

When i run only the subvi and change the cluster values in the subvi, everything works!


Thanks for help.
0 Kudos
Message 1 of 6
(2,506 Views)
The event structure, for the most part, only responds to "front panel" events, of the type initiated by a user changing the actual control. Changing the value of a control programmatically does not coorespond to the "value change" event. If you want it to use the event structure you probably are going to have to use "dynamic events". In the examples there is one called "Dynamically Monitor VI's" that give some explanation of these.

P.M.
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 2 of 6
(2,492 Views)
The problem is that the cluster value does not change in the subvi when i change the value in the frontpanel.
0 Kudos
Message 3 of 6
(2,487 Views)
When you say that it doesn't change, do you mean that your event structure doesn't trigger indicating a change? The cluster in the sub-vi should change, but your event structure won't trigger on that change in the sub-vi. When I say that event structures react to user changes on the front panel I mean an event structure in the same vi as the control the user is changing, not that a change on the higher level vi's front panel cluster will trigger and event on the called vi. If you are passing a value from the calling vi, through the interface connector pane, the lower level vi's cluster will change, but it won't trigger the event. Even at the top level vi, if something in your program changes the value of a control that is "monitored" by an event structure, in that vi, it won't trigger the event, unless the program is changing the "Value(Signalling)" of that control (by using a property node). The event structure is mostly used to detect when you change a control, using the mouse or keyboard, on the front panel of the vi it is in. To trigger events programmatically (by passing different values to lower level vi's) requires more code/complexity.
What is it that you are trying to do, it is quite probable that the event structure isn't what you need. If you are just trying to trigger something in the sub-vi when the cluster value changes that can be done with saving the last cluster value in a shift register and comparing it to the new one.

Tell us what you are trying to actually do in the sub-vi when the value changes and we can probably show you how. Events have only existed for the last few versions of LabVIEW. A LOT of code was written before them. They have made many things easier, but not much can be done with events that couldn't be done without it (although it might have taken a lot of code!)

P.M.
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 4 of 6
(2,479 Views)
The cluster in the SubVI does not change. That's what i don't understand. When i use other strucures like while oder for loops the value change works.

I atached a screenshot of the subvi
0 Kudos
Message 5 of 6
(2,475 Views)
You are passing an old value to your event structure.

Move the control terminals INSIDE the event structure and it should work. The way you have done it, when the event is triggered, the event structure sees the value which was input to the left edge of the event structure WHEN THE SUBVI WAS RUN. This is NOT the current value. To get the current value, you need a terminal INSIDE the event case.

If you need more terminals, use [whisper] local variables [/whisper]

Hope this helps

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
Message 6 of 6
(2,469 Views)