執行檔多重執行

最近寫的程式需要能多重執行

因此找到了這個資訊分享給大家
可能有人知道了吧

在執行檔產生的ini檔加入
allowmultipleinstances = TRUE
如此就可以多重執行
而且每個執行的程序都是獨立的

詳細參考

http://digital.ni.com/public.nsf/websearch/AB268878693EF4B586257037004A6725?OpenDocument&node=133080_US

以下引用原文

Problem: 
Applications that I build in LabVIEW are singletons, i.e., I can only have one instance open at a time. If I double-click the executable while an instance is already running, it simply opens up the already running executable.

Can I run multiple instances of a LabVIEW executable simultaneously?

Solution: 
Yes, it is possible to run multiple instances of a LabVIEW executable at the same time. 
To do this you will need to add a line to the ini config file that is created after running a LabVIEW executable. When a LabVIEW executable is run for the first time, it creates an ini file in the same directory as, and with the same name as, the executable itself. By adding this line to the ini file, you can enable launching multiple instances of the corresponding executable. The line is:

allowmultipleinstances = TRUE

Following are the steps to accomplish this:
  • Build a LabVIEW executable
  • Run the executable one time. Observe that an ini config file is created in the same directory as the executable
  • Close the execution of the application and open the configuration ini file
  • Add the following line to the ini file beneath the [<Application_Title>] line, where<Appliction_Title> is the name of your executable:
    allowmultipleinstances = TRUE
  • Save and close the ini file.
  • You can now run multiple instances of this application simultaneously
Note: A reference to a Queue or Semaphore is only valid inside the process in which it was created. When both VIs are running in the LabVIEW development environment, they both belong to the same process. When you build the VIs into executables, each executable becomes its own process. So the reference created inside one executable is meaningless inside the other executable. In the case that you only build one VI into an executable and run the other VI in the LabVIEW development environment, the same holds true, you are still dealing with two separate processes. 
orange110840385.4336574074