LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronize two while loops and one has a case structure

I need some help please.  I am attempting to merge two parallel vi's together.  Both work by themselves, but when I try use them at the same time the vi does not work or works once then quits. 

 

 

Labview 8.5.1

Windows XP

cDAQ - 9172

 

Cards 

9211 - Thermocouples

9217 - RTD's

9472 - One Solenoid, channel zero

 

The bottom While loop is just to collect data from the Thermocouples and RTD's and then create a Microsoft Excel report from a Template. 

 

The top  While loop is used to turn the external power on and off to a solenoid.  The toggle switch is needed to reflux liquid on batch distillation tower, then switch on the solenoid to different reflux times depending on where the how much methanol is left in the pot still.  Bothwhile loops worked without the case structure but this VIis to be used by students and they would freak if they had to turn off the vi to change the times on the withdrawal/reflux 

 

The use of the notifiers  is an attempt to synchronize the data flow from both while loop and prevent the whole vi from waiting for the "Wait" function"  Then there is an attempt to stop both while loops when the STOP button is pressed.

Labview 5.0 to 2024.
0 Kudos
Message 1 of 4
(4,506 Views)

All these notifiers are overkill, just use a local variable.

 

You have a data depedency between the two loop (the green wire near the middle of the diagram between the loops). THis means that the upper loop cannot start until the lower loop has finished. You need to remove that wire if both loops are supposed to run in parallel.

 

Also the case structure goes inside the loop, and not vice versa.

 

You need to wire across the other case, else things become potentially invalid

Message Edited by altenbach on 05-06-2009 02:38 PM
Message 2 of 4
(4,500 Views)
removed the green wire across the two loops.  placed case structure inside while loop.   so remove the notifiers? 
Labview 5.0 to 2024.
0 Kudos
Message 3 of 4
(4,482 Views)

muskwa,

 

 

You can stop two parallel loops by using one stop button and local variables. Here is a KnowledgeBase article that demonstrates how to do this.  You don't need any of the notifiers in your program.

Regards,

Jon S.
National Instruments
LabVIEW NXG Product Owner
0 Kudos
Message 4 of 4
(4,448 Views)