07-21-2011 03:42 PM
Hi,
I had the idea to set up four parallel loops on a quad core communicating with four DUTs via serial port independently. I'm using the PXI 8430/8 and was told that independent operation of the ports is possible.
What I did was simply to set up four parallel for loops only consisting of a simple VISA write. Using the Tools>Profile>Find parallelizable loops, I was given the following warning
This For Loop may or may not be safe to parallelize. Warning(s):
- A node in the For Loop may have side effects.
Does this mean, that the VISA driver VIs are not suited for multithreading? Using LV2010
Thanks for your comments!
Cheers
Oli
Solved! Go to Solution.
07-21-2011 04:43 PM
You're not using that tool correctly. In fact, you don't need to use the tool at all, since you already have parallel loops. The intention of that tool is to parallelize a single loop. Since you've already created parallel loops, there nothing that tool can do for you.
As for NI-VISA, it is multithread safe.
07-21-2011 08:34 PM - edited 07-21-2011 08:41 PM
Here is some good reading on parallelized for loops.
As for the warning it is just that - a warning. If you are writing commands out to a device and the commands need to be received in order then you can not parallelize the loop. If order does not matter then go for it. But in the case of VISA writes a parallelized loop will not buy you anything. They are meant for computationally intnesive operations.
Just stick to four loops.
07-23-2011 11:18 AM
Hi guys,
thanks for your help. Until now I thought that this tool should give you also a hint which of my parallel loops are indeed running on separate cores.
My application is running smoothly now, even checked the data using an oscilloscope. Multithreading is great
Enjoy your weekend!
Oli