LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

State machine with using event case

Solved!
Go to solution

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!!

flow diagram.PNG

 

 

0 Kudos
Message 1 of 9
(2,962 Views)

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.

Avoid Property Node


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 2 of 9
(2,939 Views)

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.

0 Kudos
Message 3 of 9
(2,931 Views)

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!

 

0 Kudos
Message 4 of 9
(2,922 Views)

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.


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 5 of 9
(2,880 Views)

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).

0 Kudos
Message 6 of 9
(2,865 Views)
Solution
Accepted by mexaviesta

My bad, dint tested before posting (over confidence kills)...!!

Let me know, if it works this time....!!


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 7 of 9
(2,856 Views)

thanks very much, it works now, super!! thanks again!!

 

best regards!

 

0 Kudos
Message 8 of 9
(2,851 Views)

@mexaviesta wrote:

it works now


Then you can mark that particular reply as solution.


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 9 of 9
(2,836 Views)