LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timed loop priorities / Priority shemes / real-time / non-real-time systems

Solved!
Go to solution

I tested the attached VI on a Virtual Machine, running on a 32bit NON-real-time-system, LV2015 full develpement, Win7, 4 cores (Intel i7-4810MQ).

The last timed loop with priority 105 gets executed as completely latest loop. It seems for me that this depends on the number of cores (not number of Processors or CPUs as stated in some NI references and the timed loop help), and that the timed loop priority is not reliable if the number of timed structures is higher than the number of cores.

 

My questions:

- Why is the timed loop with priority 105 not executed as first loop?

- Is this behavior the same on a real-time system? What are the relevant aspects considering this observed behavior?

- I am wondering about the functioning of the two priority shemes in labview (VI Priority and timed structure priority) anyway. Do they work / make sense on non-real-time system at all?

Download All
0 Kudos
Message 1 of 4
(2,932 Views)

Hi sh,

 

Why is the timed loop with priority 105 not executed as first loop?

Because you programmed a DATAFLOW dependency!

 

I am wondering about the functioning of the two priority shemes in labview (VI Priority and timed structure priority) anyway. Do they work / make sense on non-real-time system at all?

On a non-RT system they don't make a lot of sense as they limit code execution to one thread.

 

In your VI the loops run at 1ms intervals which is by far enough to execute the loops in parallel each iteration of those loops will only take nano- or microseconds! So your example doesn't make any sense at all: what's the use of priorities when the code can be executed without any problems in parallel?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,925 Views)
Solution
Accepted by topic author shquick

@shquick wrote:

- Why is the timed loop with priority 105 not executed as first loop?


To add to GerdW's comment, you have a wire going out of Loop4 and into Loop5.  Therefore, Loop5 cannot run until Loop4 is complete.

 


@shquick wrote:

- I am wondering about the functioning of the two priority shemes in labview (VI Priority and timed structure priority) anyway. Do they work / make sense on non-real-time system at all?


Nope.  I have found Timed Loops to do nothing but cause issues on non-RT systems (add overhead, single thread everything inside of them, can cause some really weird interactions with the OS due to prioritization).  The only thing a Timed Loop can possibly be useful for, in my experience, is if you need to have a piece of code run on a specific CPU core.  And if you are doing that, there is usually something wrong with your program to begin with.


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 4
(2,898 Views)

My fault, connecting loop104 to loop105 was bad implementation.

 

Thank you for the quick replies and for solving my self-generated problem.

 

 

0 Kudos
Message 4 of 4
(2,885 Views)