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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Parallel timer execution using same timer vi FGV

I would to use two timers independently, one gives the time elapsed at every 5sec and other at 1sec interval, I have used the timer FGV for both the timers, 

 

In my code attached in zip file, the vi named "only one timer.vi" works perfectly fine for single timer, but the vi named "parallel timer.vi" doesn't works as expected. 

 

How do I make it right.

0 Kudos
Message 1 of 4
(965 Views)

Previous labview version zip file attached here.

0 Kudos
Message 2 of 4
(964 Views)

Do you know what it means to when a subVI is "re-entrant"?

 

The problem is your subVI is non-reentrant.  That means all instances of that subVI all share the same data space and only one can execute at a time.  So the first instance runs and sets the start time in the shift register.  Then the second one runs, since there is only one actual instance of that subVI, it resets the start time.

 

Go to the subVI's  File Menu  >> VI Properties >> Execution and set it to "Preallocated Clone Reentrant Execution".  But you'll still have a problem since you actually have 6 copies of that subVI, but only 2 ones you want to work with.  You'll need to get rid of the extra copies before the loop and inside the case structure.  Just use a single copy in the loop, and change the enum constant value you send to the subVI based on your current situation.  (start, get, pause, unpause)

0 Kudos
Message 3 of 4
(946 Views)

You'll need to get rid of the extra copies before the loop and inside the case structure. Just use a single copy in the loop, and change the enum constant value you send to the subVI based on your current situation. (start, get, pause, unpause)

 

Can you elaborate this portion, I could not get it.

0 Kudos
Message 4 of 4
(894 Views)