From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
02-12-2020 11:14 AM
This should get you pretty far down the road.
02-12-2020 11:21 AM
OK this one is actually closer to what I think you are looking for. Change the timing on the timeout of the event structure to execute the loop faster.
02-13-2020 09:00 AM - edited 02-13-2020 09:11 AM
I found an example of a Event State Machine by Bob Schor and tried modifying it, but I ran into the problem when I click OK, it goes straight into the timeout rather than generating an event.
Right now most examples contain a pause or idle state but I don't want the program to be idle when I press OK after the Run is clicked.
My aim is to:
1) In the Init state, some things are initialized and then it goes to idle state and wait for user button press
2) User press Run to start the state machine (This button should only be done the first time)
3) User press OK and next state to Process 1 should be triggered WITHOUT pausing (The timeout for Process 1 should be same as Run but if I make a timeout case for Process 1 (which is identical to Run anyway) I'm uncertain of how to wire the same OK button to stop that loop
4) I didn't create more entries but if User clicks OK again it should go to process 2 and so on (until it reaches a certain Process X and the Finish event is triggered automatically or manually at any point)
p/s: please ignore the 'default if unwired' cases, everything will be wired in the real program
02-13-2020 09:11 AM
Did you look at the second example I gave you? It does not stay idle. Take a look. If you need the loop to go faster just change the time on the time out loop to make it go faster.
02-13-2020 09:18 AM - edited 02-13-2020 09:21 AM
Hi Tim,
thank you for the example but it did not work when I pressed any of the buttons (except Exit). I think it might be stuck at the timeout case too. The 'Next' button didn't generate an event to update the Current process. I think the Case structure should be inside the event structure, no?
02-13-2020 09:23 AM
You need to hit start. That loads the states into the array and starts the process. Next make it go to the next step. Stop stops the process. Exit will exit the program.
02-13-2020 09:28 AM
Yes I did that and tried with different timing. Current step shows 'none' while current process remain blank no matter if I press start or next.
02-13-2020 09:31 AM
Did you add states to the array on the front panel?
02-13-2020 09:40 AM
Yes, so then the start works, and then nothing else, not even the exit anymore. Because the it goes to the next state in the case selector and there's no event case to detect any other button press.
02-13-2020 09:42 AM
I fixed that on the second example v