10-10-2015 01:51 AM
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
10-10-2015 11:32 AM
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.
10-10-2015 12:45 PM
10-11-2015 10:16 AM
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