10-02-2018 08:07 PM
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
Solved! Go to Solution.
10-02-2018 10:31 PM - edited 10-02-2018 10:32 PM
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.
10-02-2018 10:34 PM
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.
I recommend you review the example State Machine project that ships with LabVIEW to guide your design.
All the best,
10-03-2018 07:51 AM
thanks!