From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Using a subVI which is called multiple times in a main program

Hi! I am using LabVIEW to aquire some signals from a fermentation in my lab and to control a step motor. I need the same program to aquire some analog signals (CO2 concentration and pressure values) and to verify the position of the step motor as well. I created a SubVI to aquire the position of the step motor by a led and a phototransistor. When it´s aligned, it means that the step motor is in the initial position. Whem I execute the subVI separately, it works perfectly. But when its called inside the main program, the led is not found so tehe step motor turns continuously. 
The subVI is called every ninety seconds inside the main program. Please, i need some help about it. 
Thanks a lot. 
Pisani

0 Kudos
Message 1 of 3
(2,600 Views)

Perhaps you are not passing or returning any parameters to the subVI. Attach your code so someone can look at it and not have guess.

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

 Ok. I´m sendind the subVI that i called "AchaOrigem". This subVI is inside the other program in wich there is a lot of analog simultaneous measurements. When this subVI is called, I stop the measurements that I called "medidas1". This subVI works properly when it is executed alone. But inside my main program, or I receve a message "Specif operation cannot be performed while the task is running. Task name: Medidas1"

 When I didn´t stopped the Medidas1 task, the phototransistor isn´t recognized and the step motor turns without stopping.

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