LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multiple instances of an exe (and of a VI)

Hi all,
   I need to run an exe I created with application builder, more than one time.  I have to run two separate instances of this exe.

   More, I'm still interested in calling a subVI more than once from a top level VI, and the two instances of the subVI should run in parallel, with different inputs.

   is there some reference for this?  Thanks everybody!

graziano
0 Kudos
Message 1 of 19
(4,270 Views)
Hi graziano,

for your second point:
for running a vi twice (or more) in parallel you have to set it to reentrant in it's execution options...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 19
(4,263 Views)

Reentrancy is probably your best bet for calling a SubVI several times with unique data space. I don't know about the executable part.

Message Edited by JeffOverton on 03-10-2008 12:02 PM

Message 3 of 19
(4,262 Views)
Hi All!
   Thanks for interesting in my problem!

   Reentrancy is a good solution, i'll use it to build an Action Engine, which will be the core manipulator of a unique data space.  But the VIs I'd call twice from the main VI consists of an endless while loop....

    Apart from this, the main issue is running an exe twice (it's a different project than above!), I can do that simply replicating .exe, but I wondered if there's a smarter way....

graziano
0 Kudos
Message 4 of 19
(4,251 Views)
Hi Graziano,

be careful: the action engine should be (IMHO) never be set to reentrant as it should store your data safely!!!

For your exe:
I don't think (I don't know for sure) there's a better (aka simpler) way to start the exe more than once than simply copy&rename it as often as needed. I think the RunTimeEngine will separate the different exe's by their name...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 19
(4,244 Views)
Sorry!
   You're absolutely right, I always mistake reentrant with non reentrant.  It is reentrant VI that creates a separate data space! Of course I have to force action engine to have one single instance!

graziano
0 Kudos
Message 6 of 19
(4,241 Views)
...the simplest way to explain my task: actually, the 2 calls to the same subVI should create two different thread, vecause they're parallel loops.  Is this possible, in a more elegant way Smiley Happy than renaming subVI and calling two different names?

graziano
0 Kudos
Message 7 of 19
(4,233 Views)
You can also add these two lines to your program's generated INI file:

[ApplicationName]


allowmultipleinstances = TRUE

Good Luck!
Message 8 of 19
(4,231 Views)
Gerd wrote "be careful: the action engine should be (IMHO) never be set to reentrant as it should store your data safely!!!"
 
AE can be used to do averaging of a signal. In that case, a reentrant AE can be coded once and used many times. I believe the NI PID toolkit is implemented using this approach.
 
Templates are very usefully when you want the same VI to run as multiple instances. LV creates a new instance each time you open a template, have allowed FP updates going back to the beginning of time and are available in the exe environment.
 
Ben


Message Edited by Ben on 03-10-2008 11:51 AM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 9 of 19
(4,226 Views)
Hi!
   It works fine, thanks!  But this lead to some questions Smiley Happy

   - Where do I find infos on editing application generated .ini files?

   - Isn't there a way to do this for an application build with "application builder"? Or should i tell user to manually edit .ini file?

   Really thanks again!

graziano

PS.: I spent some years in building embedded LV applications, so every time it comes to graphical interfaces or PC-based apps in general, I need help Smiley Tongue ..... perhaps, sometimes I need help on FieldPoint too Smiley Sad
0 Kudos
Message 10 of 19
(4,217 Views)