LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Multiple Instances of LabVIEW from C#

I have been searching for answer to this question for several hours now, and have failed to find anything that has worked successfully.  Currently, I am trying to create multiple instances of the same LabVIEW application using C#:  The goal is to to display a new instance labview appilcation whenever the user presses an "OK" button on the winforms UI:

 

... some code

MyLabViewApp app = new MyLabViewApp();

... 

 

However, each time I press the 'OK' button, it does not open up a new instance, but rather just returns focus to the currently running instance.  I have specified in the .ini file to allow for multiple instances, so that is not the issue.  I am referencing the .tlb generate when I build my LabVIEW application in the C# application.  

 

Note:  I can open up multiple instances when double-clicking on the actually .exe file, but cannot when calling from C#

 

Any suggestions?

 

 

0 Kudos
Message 1 of 6
(2,706 Views)

Thank you for your reply Kate, but I need to be able to pass data between C# and multiple instances of LabVIEW, so using Process.Start()... would not work in my case.  To clarify my issue, I need to be able to open up multiple instances of a LabVIEW application via ActiveX and COM interop, so I can pass data to specific controls within LabVIEW.

0 Kudos
Message 3 of 6
(2,678 Views)

djvbasebal,

 

I just wanted to pass along a little information. Labview builds executables as singletons, meaning only one instance is run at a time unless you add a specific configuration line in the .ini file created by the executable. I have provided a link to a support article that takes you through the process of creating an executable that can be called for multiple instantiation. 

 

http://digital.ni.com/public.nsf/allkb/AB268878693EF4B586257037004A6725

 

 

Applications/Systems/Test
National Instruments | AWR Group
0 Kudos
Message 4 of 6
(2,658 Views)

Thank you PeanutButter, but unfortunality, I have that specified in the .ini file as mentioned in the original post.  This could be an issue of the C# application holding onto a strong reference, may need to release all previous instances from memory... not exactly sure.

0 Kudos
Message 5 of 6
(2,652 Views)

This seems like a straight C# question and not a LV issue. You might have more luck finding resources on C# dedicated forums or websites. Off the top of my head, I assume that in order to pass data amongst multiple executables you are either going to need to create shared memory spaces (which can be very dangerous in terms of coding implementation) or create some sort of database to exchange values. 

 

 

 

Mark B.

Applications/Systems/Test
National Instruments | AWR Group
0 Kudos
Message 6 of 6
(2,629 Views)