LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

run code simultaneously

Hello, i have an application for logging temperatures in different chambers. Each chamber has a start button to start the timer and logging of temperatures. The code is pretty large. I wanted to be able to run the code for many different chambers simultaneously. For Example, Press start button on Chamber 1 and have that code run. Then Press start on chamber 2 and have that code run while Chamber 1 is still runnng. The code is too large to have a lot of different case structures. I was hoping there was a way i could do this without making a lot of subvi's and Globals. Any suggestion is greatly appreciated.

Mike
0 Kudos
Message 1 of 12
(4,266 Views)
this is not a problem : you can define it as a VItemplate and run several processes simultaneously
It would be nice if you take the time to rate this answer
http://www.machinevision.ch
Message 2 of 12
(4,257 Views)
Without having any real information about the structure of your program other than "the code is too large to have a lot of case structures" it is hard to make any definitive statements. You can create indepent vi's for each chamber that encapsulate those functions that are specific to the chamber, which can communicate with the main control loop by global, LV2 globals (A.K.A. "Uninitialize Shift Registers"), Queues, etc. Depending on how the program communicates with the various chambers, you probably have one point of communications, whether GPIB, serial, Analog I/O card,whatever so this part will have to be a function common to all. It will probably require restructuring the code, realizing the common functions vs what are chamber specific. With more information we can probably give more detailed answers.


P.M.
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 3 of 12
(4,254 Views)
This is the vi i am using for stall 1 but i would like to use it for all stalls, allowing stalls to run simultaneously.
0 Kudos
Message 4 of 12
(4,237 Views)
Can you save it as a 7.0 format?? I'd like to look at it.
0 Kudos
Message 5 of 12
(4,229 Views)
HERE IT IS THANK YOU FOR LOOKING AT IT.
0 Kudos
Message 6 of 12
(4,228 Views)
Still tells me that is a 7.1 format.
0 Kudos
Message 7 of 12
(4,220 Views)
i AM NOT SURE IF IT SAVED RIGHT, IT IS GIVING ME ALOT OF WARNINGS WHEN I SAVE IT.
0 Kudos
Message 8 of 12
(4,214 Views)
 
0 Kudos
Message 9 of 12
(4,201 Views)


@GRMAN wrote:
Hello, i have an application for logging temperatures in different chambers. Each chamber has a start button to start the timer and logging of temperatures. The code is pretty large. I wanted to be able to run the code for many different chambers simultaneously. For Example, Press start button on Chamber 1 and have that code run. Then Press start on chamber 2 and have that code run while Chamber 1 is still runnng. The code is too large to have a lot of different case structures. I was hoping there was a way i could do this without making a lot of subvi's and Globals. Any suggestion is greatly appreciated.

Mike




I did something just like this a while back that worked well for me. This way you wont have to re-write or restructure your entire code.
The problem is that you can not have multiple instances of the same VI with the same name in memory, so what you have to do is create multiple instances (copies) of that VI with different names and then you can run them all simultaneously.
I wrote an application (very simple code) that does this. This utility loads a VI, copies it to another location (i.e. temp directory), renames the VI, and then runs it, after running it deletes the copy from HD, VI remains in Memory. Repeat this process to run more instances (rename the copy uniquely every time, I used a random number generator and included it in the name of the VI).
Caution, if you use a global variable, it will be shared among the instances and can cause problems.

Attached is my VI application-
Good luck.
0 Kudos
Message 10 of 12
(4,200 Views)