LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"multiple loops"

I am creating a multiple-loop (4) process control VI that passes 2 basic types of data between loops, i.e., an integer array and clusters. Originally queues were used to transfer the data, but I ran into problems when trying to dequeue more than one queue per loop. I next tried functional globals, but were just too slow to prevent the empty queue syndrome. Next came global variables, which proved to be the fastest, contradicting all conventional programming practices. All this experimentation was done on a single-core PC. I now have implemented the code on a multiple-core (4) PC. Does the use of global variables relagate the mutliple-core architecture to single-core execution? Perfmon indicate 25% CPU usage, don't know if this is one processor doing 100%, or 4 x 6%? I have seen a global queue used to transfer data, which sounds like an oxymoron, but could this be a good way to go?
0 Kudos
Message 1 of 3
(2,759 Views)

I have a dual core Laptop and I created two while loops both reading data out of the same cluser. I opened task manager to the perforamnce tab where I have it set up to show one graph per CPU. I got 100% on both graphs! Try a simple program with four loops all readying off the same global. Make sure the loops have no delays (very bad programming practise) just for this experiment.

 

Amit

 

0 Kudos
Message 2 of 3
(2,749 Views)
LabVIEW will automatically make use of multiple cores/CPUs. If you want more precise control you can use a Timed Loop, as those allow you to specify which core to use. You may also want to take a look at the information in the Multicore Programming part of the NI site.
0 Kudos
Message 3 of 3
(2,725 Views)