LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

initialize value for controller in subVi

Hello,

 

When i press the button 'call dialog', the Front Panel of the Dialog.vi will be show. And I wanted the 'New Setpoint' be automatic initialized as the current Setpoint = 2 (or any value for numeric). And i tried writing the value using a local variable during timeout, but it is not possible. the initialization should occur only once in the beginning. 

 

Thanks


Download All
0 Kudos
Message 1 of 7
(3,572 Views)
Hey, can u post screenshot of VI also.. some user like me still working on version 8.5 so unable to open ur VIs or u can post with saving in earlier version.. else u can simply write ur detailed requirement, that should also be ok to look in to problem ..
0 Kudos
Message 2 of 7
(3,558 Views)

Your dialog VI has a serious flaw.  It can only run for 1/2 second.  If the value hasn't been changed within that 1/2 second, then the timeout case runs and the subVI stops executing.

 

Also, there is no need to have value of the Call Dialog button write itself back to the local variable of the control right before the case structure in the main VI.

0 Kudos
Message 3 of 7
(3,547 Views)
erm.. ok.. because my actual program is very big n complicated... so i tried to make a simple example.. but do you know anyway i can initialize the value of my controller according to my actual reading?
0 Kudos
Message 4 of 7
(3,536 Views)
What value are you trying to initialize?  When I run your main VI, the value in Numeric shows up in the indicator called Setpoint when the Dialog VI is called.
0 Kudos
Message 5 of 7
(3,527 Views)

Your subVI is very badly written. It does not have a while loop around the event structure, the stop is just plain wrong, the extra control and use of locals is wrong, and you don't return the setpoint value. Nothing, in fact, is done correctly. Why would you call it and not return the value? You need to wire up the connector pane.

 

You should spend some time with the basic LabVIEW tutorials.

0 Kudos
Message 6 of 7
(3,520 Views)
this is my original program and i had made some changes in it.. it read and write the values thru data socket.. when i run the main program, i can call the dialog and stop the program thru the subVi. in the subVI, there is a controller named 'New CalibValue' . i would like to intialize this 'New CalibValue' as 'ValueCalib_SP'  when i start the subVi.
Download All
0 Kudos
Message 7 of 7
(3,481 Views)