LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using VISA Write in parallel loops (multithreading)

Solved!
Go to solution

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

 

0 Kudos
Message 1 of 4
(3,504 Views)

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.

Message 2 of 4
(3,496 Views)
Solution
Accepted by topic author OliWachno

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.

=====================
LabVIEW 2012


Message 3 of 4
(3,480 Views)

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 Smiley Very Happy

Enjoy your weekend!

Oli

0 Kudos
Message 4 of 4
(3,449 Views)