LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timed loop vs While loop in time critial VI

I'm having an issue with timed while loop vs std while loop.  In the enclosed VI (Cm Process Events ...) which last ran using LV 2012/2014 on Win XP.  Now I'm using LV 2015 on Win7.  I now get a compilation error that says the "Timed Loop: Timed Structure are not allowed in Time Critical VIs."  If I replace the timed while loop with a std while loop at time of deployment I get this error for the VI "... loaded with errors on the target and was closed."  When I try the solutions in http://digital.ni.com/public.nsf/allkb/7F6502FF0560FA9086257EB3005B13BA I receive the error again for another subVI.  In my main program I call 'Cm Process Events ...' using the Call By Reference Node.

 

How do I resolve this or do I need to diagnose more?  If so, how?  These are compilation (aka broken arrow) and deployment errors.

Download All
0 Kudos
Message 1 of 19
(4,166 Views)

clarification, this subVI is used in LabVIEW RT, previously and currently

0 Kudos
Message 2 of 19
(4,163 Views)

Do not make your VI Time Critical.  Any code inside of the Timed Loop actually goes above Time Critical.  Therefore, just leave the VI priority at Normal.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 19
(4,153 Views)

Timed Loops operate in a dedicated execution sub-system (Always have) and the Help file has always stated

"To avoid unexpected timing behavior, do not add a VI configured to run at time-critical priority and a Timed Loop to the same block diagram. "

 

NI has elevated the "Please Save us from ourselves" rule to throw a compile error when you fail to heed that tip.


"Should be" isn't "Is" -Jay
Message 4 of 19
(4,148 Views)
0 Kudos
Message 5 of 19
(4,114 Views)

I'm confused.  The main VI that runs on the RT controller in the PXI is set to normal priority.  Only this subVI contains a timed structure and it is set to a time critical priority.  All other subVIs used by the main VI are set to normal/subroutine priority.  This subVI captures the bus events and instigates the processing.  That's why it needs to be at a high priority.  If I change the priority to 'high' instead of 'time critical' the broken arrow goes away but then I have the deployment error on another normal priority subVI used by the main VI.  I cannot correct the deployment error using either of the methods specified in the KB article.  What am I not understanding?

0 Kudos
Message 6 of 19
(4,068 Views)

faustina wrote: What am I not understanding?

Timed Loops have their own thread pool and execute at a higher priority than Time Critical.  So set the priority of the VI to Normal.  The code inside of the Timed Loop will run at above the Time Critical priority.

 

You should generally avoid the Subroutine priority.  That can cause some interesting timing issues since it locks the thread until complete.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 19
(4,064 Views)

If you set the subVI to "normal" it will get promoted to an elevated priority when it's in a timed loop.

0 Kudos
Message 8 of 19
(4,054 Views)

what about the deployment error for the other subVI set to normal priority; not used by this subVI

0 Kudos
Message 9 of 19
(4,042 Views)

@faustina wrote:

what about the deployment error for the other subVI set to normal priority; not used by this subVI


What Error?  We cant see over your shoulder so you have to tell us.  With the vi containing the timed loop set to normal, what errors on what vis are you seeing


"Should be" isn't "Is" -Jay
0 Kudos
Message 10 of 19
(4,035 Views)