LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple instances of VI with isolated data space

Greetings,

 

I developed a production application that communicates with the external HW (USB communication). Now we are considering speeding up our process to double the external HW (each for each nest) so it means that we will also need to double our application like run in multiple instances.

 

I already found this article (https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YHwPCAW&l=en-CA) on how to do this on an executable.

 

I am trying to figure out how to do this in LabVIEW. My goal is to call the same VI with the completely isolated data space including all subVIs. I am already familiar with reentrant execution but seems that I will have to set all subVIs to reentrant execution to not share the data space. This can be a little bit complicated as some of them work like a functional global variable.

 

Exist another way that I do not know about it now? Mainly the VIs which communicate with the external HW will require to run truly parallel to be able to access different HW at the same time.

Thank you for your recommendations.

0 Kudos
Message 1 of 3
(545 Views)

Here's one way to run the same VI multiple times asynchronously.

 

https://www.ni.com/docs/en-US/bundle/labview/page/lvhowto/acbr_call_clones.html

 

If you do this the top level VI you are calling will have to be reentrant but every single VI under it doesn't need to be reentrant. It's not necessarily an issue for the asynchronous processes to share the same VIs if these VIs don't hold any data in a shift register or feedback node. As a simple example, if you have a simple VI that just adds two numbers, that could be shared by any number of asynchronous callers and not be an issue.

 

Even if VIs aren't holding any data it may be helpful to make certain VIs reentrant so execution isn't blocked by waiting for that VI instance but I would probably wouldn't start by changing the execution of every VI.

Matt J | National Instruments | CLA
0 Kudos
Message 2 of 3
(530 Views)

We used exactly the technique described by Matt (previous reply) to get LabVIEW to record "interesting behaviors" from a dozen or so Animal Testing stations.  Each Station had its own video camera and a sensor to tell us when the "behavior of interest" (lasting 5-10 seconds, and occurring every 5-10 minutes or so during a 2-hour session).  Worked like a charm.

 

Bob Schor

0 Kudos
Message 3 of 3
(500 Views)