11-14-2022 10:45 AM
Hello!
I have been looking for an answer to this littler issue for a while. I am trying to make sure the boolean control of the select function happens before the rest of the code in the case is executed. Basically what I am trying to do is have a state be "Skippable" in an automated run and execute the select before the rest of the code in the each case is run. Otherwise what happens is that the case gets executed for one loop and it changes valve positions. I tried placing the boolean control outside the case to ensure its data arrives first (which is faster) and put in data stalls in the hopes that would help but it still executes to full first loop before switching to the next state.
I have 7 of these different states which have specific valve and flow control signals they send. The nested case is meant to only execute once in each state regardless of the number of loops (for some reason the valves partly open when receiving the same signal repeatedly) and then is reset to true so that it can execute the valve change in each state only once. I need this to work through multiple iterations because the program will run through a set of cyclic loops (dependent on a number of defined loops and a redirect to the first state).
Attached are two images of the situation. Any thoughts or suggestions would be greatly appreciated.
11-14-2022 10:51 AM
You need to implement a proper state machine or Queued message handler along with an Event structure to handle UI interactions.
How familiar are you with the keywords I used above?