LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling a timer within a while loop

Hi all,

I have an application being developed that requires the use of a timer.  The application is very similar to a home air conditioning system - if the temperature meets a certain set point, then the blower will kick on for a specified amount of time.  The conditional statement produces a boolean output, and once that condition is met, then I want to enable a blower motor (controlled by a digital line to the driver circuit) for a user specified time.  The problem is that the temp sensor has a wide tolerance - it could read 80 degrees for one second, then the next it could be down to 79 degrees.  If that happens, then the logic becomes FALSE and the case structure reverts, which turns off the blower.

Is there a way in LabVIEW to latch and hold a boolean output?  If I get a temp reading that meets the criteria, then once that output goes TRUE I want it to stay in that state until the timer expires, at which point the state would be reset.  In addition, the temperature still needs to be read every second, so I can't run a while loop within the case structure.  I'd appreciate any input.

Using LabVIEW 7.1 on Windows XP with a PCI-6014

Thanks,
tsc
0 Kudos
Message 1 of 6
(3,451 Views)

Hi

I guess you want to cool down something - so why don't you set a the motor if the temperature is higher than a certain value and reset it if it is lower than another certain value?

Thomas

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 2 of 6
(3,447 Views)

It's me again.

I attach a simple example how you could do it.

If the measured values jump "wildly", try to average them before processing - this "calms" them down.

Thomas

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 3 of 6
(3,443 Views)
Thanks for the example - I can use this to prevent the "bounce".  The problem is that I'm using the DAQ Assistant to control the logic output for DIO port 0.  It requires an array of boolean.  I've modified the program to add your example, however it's not latching.  I can't create a property node to the DAQ Assistant to control one object.  The other issue is running the timer - I've got to provide a set time for the motor to run.  Maybe I've been thinking on this too long - I just can't seem to put it together right.
0 Kudos
Message 4 of 6
(3,437 Views)

Yes you can't create a latching express vi - but instead of controling the express vi there directly, feed a queue. Have a look at the producer / consumer pattern. You could produce an element where I set the boolean and in a separate loop consume the element to control your motor. There you also can control the timer.

Hope this helps you. I'll be on holiday the next three weeks, but there will be others to help you.

Thomas

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 5 of 6
(3,424 Views)
Thanks for your help - I got it doing most of what I need it to do.  I ended up creating a control on the front panel, and using your example, made a property node to that object to that I could control the case statement.
0 Kudos
Message 6 of 6
(3,419 Views)