05-19-2014 02:57 AM
Hallo everyone,
i have a question about how to realize the "Timeout". In the flow diagram below we can see 2 different situation:
1. in the 1st Situation i have used the state machine, it begins at state 1, which contains a event case. In there it will be at first determined, if the input value has changed within 10 second, if it didn't, the state machine will go to state 2, if it 's changed, will be furthermore determined, whether the input value equal to 3, if yes, the state mashine will jump to state 3, if no, jump back to state 1. (this VI i have done before, you can take a look at the Attachment).
2. my question is in the 2nd situation. It begins also at state 1. In there the input value can also be changed (once or many times) or not. If the value has not been changed within 10 s, or even though it's been changed many times within 10s, but it's never been equal to 3, the state machine will go to state 2; only when the input value within 10s equal to 3, it can jump to state 3.
This problem i have no idea how to solve, does anybody have idea or better methods?
thanks a lot!!
Solved! Go to Solution.
05-19-2014 03:44 AM - last edited on 10-10-2024 12:10 PM by Content Cleaner
Think of using Elapsed Time in conjunction with timeout.
Also in the event structure, you can use event data node to get the new value of the control, the event structure state is configured for, thus can avoid using property node.
05-19-2014 04:11 AM
Hi,
I think you want to shift from state1 to state2 when timeout occures or value change(Value not equal to 3).
Othercase is state1 to state3 when value changes and value=3.
just modified little and check attached VI.
05-19-2014 05:09 AM
thanks very much for replying...
In the 2nd situation i want to shift from state1 to state2 only when the 10 seconds run out. It means, the input value can always be changed within 10 seconds as long as the input value not equal to 3.
But what you have modified is, that the state 1 jumps immediately to state 2, if the value changes.
still thank you very much!
05-19-2014 07:38 AM
The statement in the OP is not covering all cases.
@mexaviesta wrote:
2. my question is in the 2nd situation. It begins also at state 1. In there the input value can also be changed (once or many times) or not. If the value has not been changed within 10 s, or even though it's been changed many times within 10s, but it's never been equal to 3, the state machine will go to state 2; only when the input value within 10s equal to 3, it can jump to state 3.
This problem i have no idea how to solve, does anybody have idea or better methods?
thanks a lot!!
Just check my implementation for Situation 2 and let us know, if it works for you.
05-19-2014 08:05 AM
Thanks a lot! but it doesn't work for me. At first i set the input value 2, and start this VI, then we can see the "Time Elasped in sec" runs, at this time (time running) if i change the input value to for example 1 (not 3), the time stop running, and this VI will not stop after 10s.
As i have wrote, my aim is: during the time runing(10 s), we can change the input value what ever how many times, if the value has not been changed to 3, or the value has not been changed at all, the time will be still runing till 10s, then go to state 2 (this part doesn't work). If the value has been changed once to 3 during the 10 s, goto state 3 (this part works).
05-19-2014 08:22 AM
My bad, dint tested before posting (over confidence kills)...!!
Let me know, if it works this time....!!
05-19-2014 08:30 AM
thanks very much, it works now, super!! thanks again!!
best regards!
05-19-2014 09:46 AM
@mexaviesta wrote:
it works now
Then you can mark that particular reply as solution.