From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I compile Labview program so multiple instances run on one computer?

I would like to have the ability to run multiple instances of a single executable Labview program  on the same computer.  Is there an option I should set during compilation?
0 Kudos
Message 1 of 6
(3,868 Views)

Completely ignoring issue surounding shared resources (same file. I/O devices, network connections etc.)

 

Just copy your exe to unique names and run them.

 

EG

 

App name = Test.exe

 

copy to new names

 

Test1.exe

Test2.exe

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 6
(3,865 Views)

There is an INI setting:

allowmultipleinstances = TRUE 

 

Ton

 

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 3 of 6
(3,847 Views)

TonP wrote:

There is an INI setting:

allowmultipleinstances = TRUE 

 

Ton

 


 

The INI file setting is for running multiple instances of LabVIEW, not necessarily multiple instances of a LabVIEW run-time application, correct? 
>

"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
0 Kudos
Message 4 of 6
(3,843 Views)

The linked wiki page suggests it also works for executables.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 5 of 6
(3,826 Views)

Do you need the multiple instances to communicate?  If so, use the INI file settings and VI server to launch them into the same run time engine.  These settings in your INI file may be of use.

 

server.tcp.enabled=true
hideRootWindow=true
server.tcp.port=nnnn
server.tcp.access="+localhost"

 

Make sure you use a unique port number.  Launch your main VIs by first using Open Application Reference with the port in your INI file and "localhost" as the machine name.  Then use this application reference to open your main VI using Open VI Reference.  Run it using the Run method with Wait Until Done set to FALSE and Autodispose Ref set to TRUE.  Make sure it has its front panel open before you close your launcher or the LabVIEW runtime engine will close (since you have the VI ref, you can do a slow poll on the execution state or front panel open/closed properties).

 

Be careful with shared VIs.  Reentrancy and VI templates are your friends.

0 Kudos
Message 6 of 6
(3,807 Views)