LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

issue with running two vi simultaneorsly

Hi,

 

I am running one vi to generate pulse and another for measuering current. generaton vi has DC voltage for 10 mins in 1st sequence and folloed by pulsed voltage reduction in 2nd sequence. While reading current for 2nd sequence current saving stops. Can some one help me with the solution?

I am attaching both vi

 

Thanks

 

 

0 Kudos
Message 1 of 4
(2,852 Views)

You can't have two different VI's trying to run at the same time accessing the same resource.  You are probably getting access violation errors of some sort on the VI that seems to stop working.  And because you use a shift register on the error wire (generally a bad idea despite a number of people who claim you should), once you get an error, that error persists forever and prevents any later iterations of your loop from actually doing anything.

 

PS  Why are you opening the same file inside of that while loop on every iteration, and you never close it?  You should open a file before a loop, read or write inside the loop, clost the file after the loop.

0 Kudos
Message 2 of 4
(2,818 Views)
I am running one program to generate voltage pulse which is working fine . 2 nd program is to read the current from the instrument (100ms data reading) but it stops the moment 1st program shifting from 1st sequence to second. I am not getting any error message, second Vi continue to run but does not collect data from instrument.
0 Kudos
Message 3 of 4
(2,806 Views)

I assume that you do know that LabVIEW uses DataFlow as its basic Programming Paradigm, which means that you can have one program with two independent, asynchronous loops (such as the two routines you attached) running essentially in parallel.  This works best when the two loops have a natural "clocking" behavior, such as doing DAQmx I/O at a particular timed rate, or doing file I/O as data are being generated.

 

If you are running in "Development Mode" (meaning that LabVIEW itself is open for editing and running VIs), then it is difficult (impossible?) to have two VIs running under "Front Panel Control" at the same time.  However, there is nothing stopping you from building two executable routines and running them at the same time (how you start them together is a trick, but you can clearly double-click one, then double-click the other).  Of course, if they need to "share data", you need to program that into their behavior.

 

It sounds to me like you are something of a LabVIEW Beginner, who might benefit from spending several hours with the LabVIEW Tutorials, particularly the more advanced ones.  You could also explore the Projects and Templates that ship with LabVIEW -- some of them cover the kinds of multi-processing that I think you are trying to do.

 

Bob Schor

0 Kudos
Message 4 of 4
(2,768 Views)