06-01-2010 05:08 PM
Hi everyone,
Is it possible to have a state machine with timed loop? i.e. on the last state, we wait there until the end of the period to change back to the initial state again.
Thanks
Solved! Go to Solution.
06-01-2010 05:33 PM
crazycompgeek wrote:Hi everyone,
Is it possible to have a state machine with timed loop? i.e. on the last state, we wait there until the end of the period to change back to the initial state again.
Thanks
Yes. However, when the loop is running, there will be no way to stop the program or to do any other action. But if that is what you want, yes it is possible.
06-02-2010 05:12 AM
06-02-2010 07:07 AM
In the picture below, sequence named "first" stay for five minutes and then move to "second" secuence.. you can make this logic as your last sequence, this will wait for defined time elapse before going back to initial state again..
Hope it helps..
Regards
HS
10-29-2012 10:20 AM
What does one need to implement in the final state for the state machine to become idle until the next timed loop cycle? Add a wait that is longer than a loop cycle, add an empty while loop, etc? I am stuck on this question.
(this is an instance of state-machine type of reading digital inputs) After a sequence of reads is done, do nothing until the next reading sequence begins (at a specified sampling rate)).
Thanks for the help, Luka
10-30-2012 02:04 PM
I've attached a state machine example to show how you can stay at a specific state until an input gives when to move to a different state.
https://decibel.ni.com/content/docs/DOC-22972
For your case, you need to decide how your code "begins" to change from a waiting state to a sampling state. In the example, in the "Intruder?" state the input of the Intruder button chooses between changing between the "Log Intrustion" state or staying in the same "Intruder?" state. For you, it will be advantageous to have a logic statement that yields a true when you want to start sampling data again or a false when you want to stay in the wait for data state.
02-28-2013 06:17 PM
Hello
I am trying to work on some states machine using the ELVIS II FPGA board. There are 3 states: idle, count up, count down
At count up, I should display 0-99 then move to cound down, showing 99-0. If during count up user press a button on board, it should abort and return to idle.
Maybe bad approach by using a for loop to create the counts, because once into for loop, it wont read any button until after finish. Based on your post, do you have any other approach to this?
02-28-2013 06:28 PM
You should probably start a new thread. This one is several months old and has been marked as solved.
The button terminal must be inside the loop tobe read.
Lynn