LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I run two almost identical LabVIEW programs in parallel?

I'm thinking of running two almost identical LabVIEW programs in parallel because the hardware has the capacity to test two devices simultaneously. I have tried to avoid calling resources at the same time, but then I noticed that the programs are still internally linked. What I mean is that if one program is running certain part, the other program is also running same part even though it's not supposed to. This is the first time I tried to do it this way, right now, I have some doubt whether it's doable. Anyone can give some advice?

 

Thanks,

0 Kudos
Message 1 of 21
(5,134 Views)

If you have any shared code that can take a while to run make sure you configure it to be reentrant. That way you will get multiple, independent copies of the code. The basic answer to your quetsion though is yes, it is possible.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 2 of 21
(5,129 Views)

How are you running them?  Are they in the development environment, or did you build and executable?  If in the development environment, are you using two different projects?

 

If you are in the development environment, and both your programs are using the same named VI, that VI is going to be shared unless you made it re-entrant.  If each program is in a different project, then LabVIEW will create a separate application space for each program.  (Not sure if there is a potential for other conflicts.)  If you are running .exe's, then you shouldn't have any problems at all because the programs will definitely be in different application instances.

Message 3 of 21
(5,128 Views)

Hi Mark Yedinak,

 

Thanks for the information and encouragement. I set both of the two vis to reentrant, but the problem exists. I can see that when one program is running, the other program's same part is also running.

0 Kudos
Message 4 of 21
(5,120 Views)

What is the "same part"?  That is what you need to have be reentrant.

0 Kudos
Message 5 of 21
(5,118 Views)

Hi Ravens Fan,

 

They are running in the develepment environment now, both of the programs are in the same projects, but the two vis with different names. The two program share subvis, but the part I saw conflict is not in subvis. I will try to build executables to see whether they can work together.

 

Thanks for help,

0 Kudos
Message 6 of 21
(5,116 Views)

It's in an event structure. While both vis are running, if I run one event in one program (I have probes in both vis), I saw the counter part of the other program is also running, even though it's not suppose to run at all.

0 Kudos
Message 7 of 21
(5,110 Views)

Hi Ravens Fan,

 

I made the executable (two programs in same project and built into one executable), I saw very similar kind of behavier as in the development environment. Should I make the two executables seperately in different projects?

0 Kudos
Message 8 of 21
(5,096 Views)

I tried again to build the two executables seperately (still in same project), looks they are running indepedently. I'll work in this derection and post it here if there's further problem.

 

Thanks for the help,

0 Kudos
Message 9 of 21
(5,088 Views)

Yes. Two separate executables.  That way there are two separate application instances.

 

Putting both into one executable (not sure how you did that because I still don't have a clear idea of your exact architecture) means you still only have one application instance and the common components are shared.

Message 10 of 21
(5,086 Views)