10-16-2017 01:34 PM
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.
10-16-2017 01:35 PM
clarification, this subVI is used in LabVIEW RT, previously and currently
10-16-2017 01:56 PM
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.
10-16-2017 02:04 PM
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.
10-16-2017 04:29 PM
FYI, between time critical and high priority
10-17-2017 12:37 PM
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?
10-17-2017 01:14 PM
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.
10-17-2017 01:52 PM - edited 10-17-2017 01:55 PM
If you set the subVI to "normal" it will get promoted to an elevated priority when it's in a timed loop.
10-17-2017 02:31 PM
what about the deployment error for the other subVI set to normal priority; not used by this subVI
10-17-2017 03:43 PM
@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