LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Dynamic Event Registration for a SubVI

Solved!
Go to solution

Greetings to the LV forum,

 

I am having a problem using dynamic event registration in a SubVI and hope someone here can help! Attached is the culmination of numerous attempts trying to figure out dynamic event registration. Essentially what I'm trying to do with the attached VIs is to 1.) have a knob that controls PWM output, 2.) a speed selection menu that can input to said knob in 1.) with an array of pre-defined pwm values; and finally, 3.) to have some sort of event program that "links" the controls in 1.) and 2.) (i.e if I move the knob to an exact value contained in the array, the speed selection should correspond to this event). So far I can say for sure that the "speed selection" event card won't work because "New Value" & "Old Value" are now referring to the refnum and not the speed selection control (I intend to fix this after I have solved this current SubVI issue). However the Motor Speed PWM event card should work (when the knob matches one of the array values, the speed selected will also report to the "speed selection" control), which allowed me to arrive to my conclusion that the SubVI is not working. 

 

My reference for SubVI Dynamic Event Registration: http://digital.ni.com/public.nsf/allkb/A882E27D1D7A949386256E0D0066B91A

Download All
0 Kudos
Message 1 of 3
(2,640 Views)
Solution
Accepted by 1cecream

You need to make a different state for 'Timeout' in the subVI, and also avoid passing Timeout value as -1.

 

Find the attached modified code.


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


Message 2 of 3
(2,626 Views)

Thanks Moderator,

 

I finally got the TopVI and SubVI to work. However there were a few innate problems in coding that needed modification, but after recieving help from another post the VIs now work perfectly.

 

For anyone interested the VIs can be found here: http://forums.ni.com/t5/LabVIEW/Simultaneously-inputting-into-local-variable-of-a-Numeric/m-p/249027...

0 Kudos
Message 3 of 3
(2,592 Views)