Jump to content

Multiple Instances of LabVIEW: Difference between revisions

From LabVIEW Wiki
New page: ==Running multiple instances of LabVIEW== '''Windows:''' You have to do this little trick. Create a new drive letter that maps the LabVIEW installation directory as a drive letter. From ...
(No difference)

Revision as of 06:49, 17 March 2007

Running multiple instances of LabVIEW

Windows:

You have to do this little trick. Create a new drive letter that maps the LabVIEW installation directory as a drive letter. From a command prompt, use the SUBST command to create a new drive letter ("L" in this case):

C:\> SUBST L: "C:\Program Files\National Instruments\LabVIEW 7.0"

You can now launch your new "instance" of the LabVIEW Development Environment by running the command:

C:\> L:\LabVIEW.exe

Or, you can launch the new instance of LabVIEW by double clicking on the LabVIEW.exe application icon inside the F:\ drive in Windows File Explorer.

When you are finished using your new instance of the development environment, delete the new drive mapping by entering the SUBST command with the /D switch:

C:\> SUBST L: /D

Note that you can run as many instances of LabVIEW as you can create drive letters.

[quote=Help printout for the SUBST command]Associates a path with a drive letter.

SUBST [drive1: [drive2:]path] SUBST drive1: /D

drive1: Specifies a virtual drive to which you want to assign a path. [drive2:]path Specifies a physical drive and path you want to assign a virtual drive. /D Deletes a substituted (virtual) drive.

Type SUBST with no parameters to display a list of current virtual drives.[/quote]


Linux:

In Linux you get a new instance of the LabVIEW development environment each time you run the LabVIEW executable </usr/local/lv70/labview>, unless you pass the "-launch" command line argument. For example:

$ /usr/local/lv70/labview -launch

[quote=Help for the -launch command-line argument on UNIX/Linux plaforms]LabVIEW launches and checks for an existing instance of LabVIEW already running on the same display. If an existing instance is running, the existing instance opens the VIs passed in the command line, and the new instance of LabVIEW quits silently. If an existing instance is not running, LabVIEW opens the VIs passed in the command line in the new instance.[/quote]

One problem when running instances from mapped directories is that the same labview.ini file is used for all instances so that can cause conflicts. It is better to specify a different ini file using the -pref command line switch. The method is best implemented when launching LabVIEW with a batch file, with commands that maps the directory/drive, launch LabVIEW with ini file and eventually unmap directory after LabVIEW exits.


Other Methods:

Under Windows (and I assume other OSes as well) you can map a new network folder with a target of LabVIEW.exe in that attached to an icon on your desktop. I use this all the time to run two or three instances of LabVIEW for debugging and also to compare versions of a code tree without danger of mixing the paths to VIs.

Example: 1. Open Windows Explorer. 2. Menu: Tools >> Map Network drive... 3. In Map Network Drive Dialog: Select a new drive letter (something hight like j: 4. Browse Button -> to your .\LabVIEW\ folder 5. Check Reconnect at Login 6. Press Finish 7. Go to the new J: folder in Windows Explorer, right click on LabVIEW.exe and create a shortcut for your desktop. Label it "LabVIEW x.x Instance N"

Now each time you start up your machine you have multiple instances available. You can even copy-Paste code snippets in between, by saving a Copy-Paste VI.vi in your temp directory and copy to it, save (in Instance 1), then close and open in Instance 2. Otherwise the memory spaces are completely separate.

WISHLIST: that we had a special direct clipboard, just in LabVIEW for copy-paste in memory.

Easiest Way

allowmultipleinstances=True

Throw it in any EXE's ini INCLUDING Labview.ini