LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting Control Value Prior to Entering Case

Solved!
Go to solution

In attached VI I want to initialize the SP value to zero for a couple seconds when transitioning from case 1,2,3, and 4 to case 0 (manual set point),  Actually, its not necessary to initialize when transitioning from case 1 to case 0 (value is set to zero case 1) but if that bit of redundancy makes it easier I am ok with that.

 

In the future SP will be an output voltage sent to hardware and RO will be a voltage read from hardware.

 

Suggested techniques appreciated.

 

Thx

 

 

0 Kudos
Message 1 of 4
(2,101 Views)

Please post the code in 2011 version

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 4
(2,078 Views)
Solution
Accepted by topic author ggress1

Well, the right way would be to implement a proper state machine that is aware of all the transitions.

 

In a simple case like this, you could just do something like in the attached modification.

 

(Note that I took the liberty to simplify a few things: Why do you need so many diagram constant with the same value? Don't be afraid to branch the wire and use only one each. Even simpler would be to combine all the nonzero cases into one. property nodes are relatively expensive, so use them only if the input actually has changed, and not over and over. Instead of value properties, use local variables. Much more efficient! You write to RO with every iteration, so that belongs after the case structure. No need for value properties or local variables at all, right?

I think the case structure stack could be further simplified, but this should get you started. Good luck!)

0 Kudos
Message 3 of 4
(2,066 Views)

Altenbach:

 

Thanks for the solution !! 

 

Now I can see why I couldn't figure out how to capture this condition.  I will do my best to reverse engineer your method so I can use some of those techniques in the future.

 

I intend to learn event structures next.  Maybe then a simple intuitive solution will be more obvious to me.

 

Thx 

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