LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Parallel loops in a Real-Time and non RT subVI

Solved!
Go to solution

Hi all,

 

I seem to remember learning (obviously not well enough) that on a cRIO (vxworks) that if there was a subvi with two paralell loops and one loop went to sleep due to a wait function the other loop would also be forced to sleep as they were executing in the same thread.

 

I have a 2 questions:

1) is this completely wrong?

2) Is this also true on a normal windows OS and if so how can I test it because I tried and couldn't seem to see this behaviour?

 

Regards,

Steve.

0 Kudos
Message 1 of 4
(2,775 Views)

Steve,

     I've not used cRIO, but I am doing LabVIEW RT on a PXI.  The whole point about parallel loops is precisely that one can go to sleep (or otherwise "block") and the others will keep right on working "in parallel".  I typically have multiple parallel loops in my RT applications -- one is an Event loop that serves (among other things) as a State Machine (each change-of-state is a User Event, so this loop sits idle until something triggers a state change), one is a "Timer" loop (which serves as the Master Clock), and several handle communication queues (using TCP/IP) with the Host program.  Doing it this way, in particular having the loops with "nothing to do right now" either sleep or block (waiting for an event or a queue element, for example) lets other routines that might need the extra time (for example, to process data) to have access to CPU cycles.

 

Bob Schor

0 Kudos
Message 2 of 4
(2,762 Views)
Solution
Accepted by topic author St3ve

Hi,

 

1) is this completely wrong?

Not completely. If you have to VIs (or loops) configured as time critical (highest priority) and one goes to sleep, the whole thread goes to sleep, so also the other VI (or loop) goes to sleep. But notice this is only when configured as time critical!

 

2) Is this also true on a normal windows OS and if so how can I test it because I tried and couldn't seem to see this behaviour?

No. If a loop goes to sleep under Windows, just the loop sleeps.

 

 

Christian 

Message 3 of 4
(2,759 Views)

Hi,

 

So basically what is happening is there can only be one time critical thread running and really only one loop as if there were 2, one sleeping would force the whole thread and hence the other to sleep as well.

 

Seems reasonable!

 

Many thanks,

Steve.

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