LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

switch on/off

Solved!
Go to solution

I am not able to switch the "run interlock" and "force draft fun" when I start the program..

but I can switch them when the program is "off"

can anyone help?

 

thanks so much

0 Kudos
Message 1 of 4
(3,029 Views)
Solution
Accepted by RavensFan

First, your state enum should be a typedef as well.   It looks like all the individual enums are the same, but it seems something is different because there is a coercion dot on the output tunnel.  When I put an indicator on that wire in the loop to see which state was executing, it just gave me a number.  So something isn't right with at least one of those enum constants.  Type Def them!  Then replace all the constants with the typedef constant.  I found many of them are missing the "Ready" item.

 

Your switches are switch when pressed.  But I also see there is a state that returns them to false.  I'm thinking the code is running so fast that it is turning them back to false almost as soon as you press them.

 

But the big problem I see is that you have a state machine, but the case structure is controlled by the Initialize constant from outside the loop.  You aren't following whatever is in the shift register.  So only initialize case ever runs, and that is always resetting the switches.

 

PS:  My general rule is that all enums, and all clusters, should be defined as a Type Def control.  That way you make a change in one place, and it won't break all the other places in your code where that is used.

0 Kudos
Message 2 of 4
(2,997 Views)
Solution
Accepted by topic author idjuven1

idjuven1,

 

Seems like your state machine is constantly running the same case, since you do not have the shift register going to the case selector.

 

Since you are using a local variable to initialize your Boiler Simulation Controls, each time the Initialize case runs (every 100 ms), the controls reset, and what's why they go to False again.

Screen Shot 2018-10-02 at 10.30.02 PM.png

 

 

 

I recommend you review the example State Machine project that ships with LabVIEW to guide your design.

 

All the best,

Message 3 of 4
(2,995 Views)

thanks!

0 Kudos
Message 4 of 4
(2,965 Views)