07-15-2014 05:01 AM
Hello,
I am working on a record and playback application. Well, I use the producer/consumer architecture to stream from hard drive to USRP. Surprisingly, the while-Loops do not to work parallely. Astoundingly, when both loop are running, just 3% of processor power is used. then, I turn the producer down and the consumer uses 25% of processor power; hence works properly.
How can I assign each loop to a processor?
Is it possible in labVIEW without the help of timed while loop? since even using timed while-loop do not solve the problem.
I am working on intel core i5-2500 @ 3,3GHz processor and LabVIEW 2013 SP1 is installed.
A similar issue was reported on the thread here. just that in my case LabVIEW doesn't crashes. Only the performance of individual loops drops.
You find my VI attached to this Post!
Thanks for your help
Bolivar
07-15-2014 05:44 AM
Hi!
You can try using a parallelized for loop:
http://www.ni.com/white-paper/9393/en/
Regards,
Marco
07-15-2014 05:57 AM
There's no VI attached to your post.
While loops will run in parallel if they have no inter-dependency. It will help greatly to see your code, so please try to attach your VI to a reply.
It is unlikely a parallelised for loop will help you unless your while loops are performing identical codes.
07-15-2014 06:56 AM - edited 07-15-2014 07:00 AM
Sorry, here the VI
07-15-2014 06:59 AM
VIs sometimes have issues attaching to the forum. Try zipping up the VI and post the zip file.
07-15-2014 09:34 AM
Lets look at what you are doing.
From what I see you are reading from a file and streaming the data through a queue to a USRP. Did I get that right?
And you want to stream large amounts of data from one core to another?
Now I'm not the expert on multiple core tech.. but I would not expect a data transfer produced by one core and consumed by another to be the fastest possible mechanism and, given that both loops are timed they cannot even share an "Execution" system. The thread swapping must be unreal!
Now I'll sit back and wait for an expert so I can learn something today.
07-15-2014 09:50 AM
1. Get rid of the Timed Loops. You should be just fine with the normal While loops. They will also run faster for you (ie: as fast as they can).
2. What is happening inside of that Reset File.vi? I'm hoping your just set the file pointer to 0 when you are at the end of the file.
3. You have a comment in there about waiting to send another waveform to the queue. That kind of breaks the point of the Producer/Consumer. Why not just have it all in one loop?
07-15-2014 11:42 AM
Hello Crossrulz,
I tried without timed loops as well and it doesn't work better.
The record process actually works with producer / consumer architecture. However, NI recommends this architecture when two or more processes running at different speeds exchange data among each other.
I'll try and see all together in one loop.
Thanks for your suggestion.
07-15-2014 12:20 PM
Aristocrate wrote:owever, NI recommends this architecture when two or more processes running at different speeds exchange data among each other.
Is the read from file and the output to the USRP happening at different rates? Based on that comment in your code, they are running at the same rate. So it makes perfect sense to put them together and greatly simplify your VI.
07-16-2014 12:49 AM
Hi Aristocrate,
can you post your Vi for Labview 2011SP1, please?
Thanks in advance,
Marco