10-15-2013 09:40 PM
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?
10-15-2013 10:44 PM
10-16-2013 10:36 AM
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.
10-17-2013 09:14 AM
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
10-17-2013 10:35 AM
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.
10-18-2013 05:59 PM
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.