LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I make boolean real time?

I'm new to LabView and don't have the vocabulary to search for this solution, so point me in the right direction if this has been discussed before.

My program is used to read out the temperatures of a dilution refrigerator using two different LakeShore devices.  I am using two different kind of thermometers, one for high temperatures and one for low temperatures.  I have designed my program to continuously take data using events and while loops.

My problem:  While the program is running I'd like to turn on and off these low temperature thermometers.  My ideal solution would use boolean controls, wired into my temperature read out SubVi's.  Whenever I press a button, I'd like my SubVi to see that change.   I soon realized that my program does not continuously check on the value of my boolean control.  It seems like this should be an easy fix, but I'm struggling.  I guess I could just encompass my entire program in a while loop, but I was hoping for a more elegant solution.  Any advice?
0 Kudos
Message 1 of 8
(3,600 Views)


@FriedMags wrote:
 I guess I could just encompass my entire program in a while loop, but I was hoping for a more elegant solution.  Any advice?

It's all in the dataflow. So, yes, if you want the booleans to be read a regular intervals, they need to be inside the while loop. Why would you consider this inelegant? 😮
 
Just place each acquisition codes inside case structures and switch cases depending on the booleans. If the boolean is false, execute an empty case.
 
If you want, attach your program and we might be able to give you a few more pointers to more quickly become a LabVIEW expert. :).
Message 2 of 8
(3,591 Views)
Thanks for the quick response.  It turned out a large while loop didn't do the trick.  The program continuously acquires data, so I would have a while loop that doesn't stop looping until the program ends inside another while loop.  In other words, the encompassing while loop designed to check on a change in boolean value would never make it past its first iteration.  I've attached the program (not the subvi's).  All subvi's labeled "Return" have a while loop that stops when the program stops. I want these subvis to see the change in boolean value.
0 Kudos
Message 3 of 8
(3,571 Views)

You must have had something in mind when designing this VI. From my perspective it does not make any sense. Yes, that small while loop has no reasonable purpose. Is that what you meant by a "large while loop"? 😮

Can you attach the subVIs? Maybe things would make a bit more sense if we can see them.

Most likely, you want to input a reference to your boolean clusters to the subVIs, then check their values inside the subVI loops.

I think you need a few shift registers in the event loop instead of that song and dance with all these locals. What are you actually trying to do?

Message 4 of 8
(3,562 Views)
Oops, I attached a previous revision.  I'll attach the most up-to-date one now, with the RuOx SubVi's.

Let me explain.  The attached vi, "Monitor Fridge," is without any attempt to incorporate my interactive boolean.  What this program does is continuously acquire, graph and store pressures, Diode thermometers and RuOx thermometers.  Whenever a value changes an event is triggered to print and store the reading. 

What I would like to turn on and off are the RuOx thermometers.  The subvi, "Retrieve RuOx" (confusing labeled "RuOx Return" in the block diagram), is a while loop that cycles through the 5 different RuOx thermometers. 

As it is, the program works.

You'll notice the unwired  "RuOx Control" cluster with 6 boolean controls: "RuOx On?" and 5 controls for the 5 different RuOx thermometers.  I plan on designing the program so that I can separately turn off and on the 5 different RuOx thermometers, or I'll have the option to press "RuOx On?" to switch off and on the RuOx acquisition process.  I want to wire the "RuOx Control" cluster into the "Retrieve RuOx" subvi and then use a case structure to turn on and off the thermometers.  My problem is that I can't get the program to recognize the changed boolean values in the "RuOx control" cluster.

Thanks.
Download All
0 Kudos
Message 5 of 8
(3,555 Views)
and here is the last necessary subvi.
0 Kudos
Message 6 of 8
(3,554 Views)
As Altenbach indicated, you need to create a control reference from your RuOx control cluster. Pass this to your Retrieve RuOx VI where it's read INSIDE the while loop. Get rid of the small while loop with the STOP2 button. See screenshots below:




Message Edited by Bill@NGC on 08-26-2007 04:00 PM

Message 7 of 8
(3,547 Views)
Wow, that did the trick.  Thank you both for your help.  Much appreciated. 
0 Kudos
Message 8 of 8
(3,536 Views)