LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

selecting 1 of 3 exclusive

I wish to control a heater and a fan, either on or off for both..  If the temperture is too cold turn on heat.  If too hot turn on Fan. if not too cold or hot do nothing in otherwords I have two relays controlled via digital bits P1-0 and P1-1.  Actually there is a third option to shutdown if temp exceeds a Maximum, but that happens outside of this control code

Bit 0 High turns on a heater, bit 0 low turns the heater off.

Bit 1 High turns on a fan. bit 1 low turns fan off

Now I've tried somthing like this:heater-fan.png

But it isn't quite what I need.  The code pix shows that I want to regulate the heater between 55 and 60.  The Fan between 65 and 61

I vaguley recall a truth chart or something from the LabView 1 or 2 Lessons but I cannot find it

Can someone please point me in the right direction?

Gene

0 Kudos
Message 1 of 13
(2,889 Views)

Create a sorted array of limits and threshold into it with your value. The rounded down (or up) index will give you the state. Tweak as needed.

 

Start here (the second array could be an array of enums with reasonable items (low, in range, above range, way above range, etc. to be wired to a case selector)

0 Kudos
Message 2 of 13
(2,879 Views)

Just to show what Christian already stated


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 13
(2,870 Views)

Thanks to both of you.  I am looking at your suggestion  and I will add FAST responce!

Gene

0 Kudos
Message 4 of 13
(2,865 Views)

Thanks for the fast responce!!

I am looking at your answer to understand Smiley Happy

0 Kudos
Message 5 of 13
(2,863 Views)

I think I understand how the array thing works. (It is not intuitive for me), see the attached code (I'm using LV14). This may be one of those times I can code C easier?

This will send a relay command during each iteration unless someone can help me limit the digital command until a threshold is passed.

Thanks for the help  I will continue to develop this code.  I will share it when I finish

Gene

this test code will be part of a larger VI 

0 Kudos
Message 6 of 13
(2,819 Views)

@justgene wrote:

I think I understand how the array thing works. (It is not intuitive for me), see the attached code (I'm using LV14). This may be one of those times I can code C easier?

This will send a relay command during each iteration unless someone can help me limit the digital command until a threshold is passed.

Thanks for the help  I will continue to develop this code.  I will share it when I finish

Gene

this test code will be part of a larger VI 


Every iteration?  I see no loop.  Don't use the continuous run button.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 13
(2,815 Views)

Billko said"   Every iteration?  I see no loop.  Don't use the continuous run button."

too late I did... I had to ctl-alt -delete Smiley Embarassed  but the finished code will reside inside the attached code.  This will be a project (I hope) to monitor and control a test station for a 30 cell electrochemical stack  I've written a C code version using an Arduino Uno  But it has no nice HMI, and does not save data files Smiley Sad

Gene

0 Kudos
Message 8 of 13
(2,809 Views)

Why can't you use an array of cells to display? Thy all have the same range.

Why can't you use a shift register loop to set all these dynamic data attributes.

Your VI is still full of race conditions (local variable abuse) that will give you unexpected result. For example there is no guarantee that the local variables for "cycle count" and "highest cell #" get read only after the terminal is updated. Most likely they will read stale data from the previous iteration.

Your "number of records" belongs into a feedback node and only a "wire" or a "+1" primitive belong inside the cases.

0 Kudos
Message 9 of 13
(2,800 Views)

@altenbach wrote:

Why can't you use a shift register loop to set all these dynamic data attributes.


For example compare the following functionally identical code fragments:

 

(disclaimer: I never use dynamic data, so there might be even easier solutions. This is just a literal translation of whatever you are doing. If some cells really should be uppercase and some lowercase, a little bit more code is needed.).

 

SetdynAt.png

0 Kudos
Message 10 of 13
(2,793 Views)