LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically Increase/Decrease The Number of calls to Reenterant VIs (for communciation with multiple serial devices)

I have a 16-port USB-RS232 Hub that I am using to communicate with up to 16 serial-based devices. There won't always be 16 devices connected and I need an efficent means of dynamically enabling/disabling ports. The quick and dirty method would be to have 16 sequence nodes running in parallel with a case structure used to enable/disable each call to my COMM routine; however, this is huge. I would like to know if there is a more elegant means of programatically growing/shrinking the number of 'simultaneous' calls to my COMM VI. Please keep in mind that the VI is reenterant and maintaining parallelism is extremely important for this application. Any help
would be greatly apreciated. I can elaborate further if anyone requires more info..
0 Kudos
Message 1 of 3
(2,629 Views)
Hi Doug1974,

the way I solved a similar task:
create your subvi(s) for one port. save it as a .vit (template) and use the VI-Server vis to open and run (independently) as many instances your need.
For every instance you get a ref-number, you can keep in a list, so you might need only one loop.
If you need some sort of synchronising look for the occurences examples.
There are knowledge articels about this technique to run multiple instances of one vi with the vi-server.

Henrik
Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 2 of 3
(2,628 Views)
A much overdue thanks Henrik.. (I'm going back and thanking people for their answers as I never seem to get around to it..)

I solved my problem as per your suggestions..

Doug.
Message 3 of 3
(2,496 Views)