LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Main VI stops when using control references.

Hi, This is my first question on this forum. I've created an engine simulation VI which uses control references. The main VI has a data acquistion loop and control references. The control references link to another VI that runs an equation loop which continuously calculates engine speed base on data collected in the main VI. The control references work but the main VI data is collected and updated only once when the main VI starts. If I remove the control references from the main VI the daq loop runs fine. Thanks in advance for your help.

Mike
0 Kudos
Message 1 of 7
(2,978 Views)
Assuming you use the VI server to load the subvi dynamically, when loading the vi, the "Wait to finish" must be set to false, so your main loop does not wait for the subvi to finish. When the main loop is waiting for the subvi to finish, that case (loop) is "halted".

Joe
0 Kudos
Message 2 of 7
(2,978 Views)
Joe,
Thanks for the response. I do not load the subvi dynamically. I have attached a similar vi to show what I'm trying to accomplish. The DAQ vi reads the input and calculates the power. The power is sent to the "engine momentum sub" vi where the speed, as a function of time, is generated and sent back to the DAQ vi. I created the sub vi to clean up and isolate the DAQ vi from the subvi. I wanted the sub vi to run at a certain speed (by adjusting the wait time)and not affect the DAQ vi. If you input a value of 10 into the DAQ vi and then start it you will see the speed ramp up to 100. While the DAQ vi is running, I need to be able to change the input which would cause the power to change and in turn change the speed. I thought the control r
eferences were the way to go. In my real DAQ vi, I have many more inputs, all which do not update after the first reading. I considered putting the DAQ functions in another subvi and reading the outputs through control references but that seemed too cumbersome.

Thanks again,
Mike
Download All
0 Kudos
Message 3 of 7
(2,978 Views)
the Engine Momentum Subvi should finish execution with each iteration of the loop in the DAQ.vi
Therefore , connect a constant Boolean set to True to the condiotional terminal of the while Loop of the Engine Momentum Subvi (instead of the stop value from the main vi)
0 Kudos
Message 4 of 7
(2,978 Views)
I tried that and it works but the zero outside the loop which resets the shift register to zero each time the loop starts must be removed so the engine accelerates. I just need to figure out how to reset the speed to zero after I've stopped and restarted the main vi without have to close it and reopen.

Thanks,
Mike
0 Kudos
Message 5 of 7
(2,978 Views)
use first Call? to initialize.

see attached vi
0 Kudos
Message 6 of 7
(2,978 Views)
Thanks,
Nothing like have an example to explain an idea. Thanks for all the help. Hope someday I can do the same for others.

Mike
0 Kudos
Message 7 of 7
(2,978 Views)