LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

parallel sub vi

Hello,
 
I want to know the best approach to my problem ?
 
Look at the attached file (click on boucle_gen.vi). I have many devices which are initalize in the Fichier init sub VI (this part is allright).
 
How can I repeat the patern (3 index files and read qw.vi) ?
Is it possible to use the same subVI in parallel where different datas transit in it ? (I guess no)
 
Thanks
 
 
0 Kudos
Message 1 of 6
(3,524 Views)
Yes, it is possible.  Under the File menu choose VI Properties.  Choose Execution as the Category, and then check Reentrant execution.  This will allow multiple instances of your subvi to be running simultaneously with different data.
Message 2 of 6
(3,501 Views)
Can you post the code for read qw.vi. It may not be necessary to do anything to it.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 3 of 6
(3,482 Views)
Hello,
 
I want to reproduce the code line in the box in boucle_gen.vi (XX times which depends on the number of Com used). I don't want to use a for loop with a Indexation because this will run Read Dsp 9000.vi in serial.
 
How can I do this ?
 
Thanks 
0 Kudos
Message 4 of 6
(3,453 Views)

I guess my problem can be described simply by this:

 

I want to send commands to several COM ports simultaneously.

Also, the number of ports might vary in time, and I would like the code to adapt to the situation.

If I put the port addresses in an array and run an indexed loop, it works well but then the ports are accessed sequentially, which slows down the thing significantly.  I could of course create a subVI with that part of the code and put 16 copies of it on my diagram, with some test to see if each of them is needed, based on the number of active ports, but I feel this is really not elegant.

Is there a way to code so that I can access whatever ports I need (this may change) simultaneouly?

I hope that is more clear.

Many thanks for any tip that might help me.

Cheers

 

0 Kudos
Message 5 of 6
(3,436 Views)
I can't see any reason why you couldn't use any number of instances if the inner VI, as long as they are all talking to different serial ports - though if it were me I would think about doing it with a single template vi (*.vit) that you launch multiple instances of depending upon how many you need.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 6
(3,400 Views)