Lua timeevent functionality

Hi,

I'm trying to use the Lua timeevents to trigger a state transition
after a couple of seconds have passed. I didn't get it to work with my
app, so I'm trying the timeevent example now. However, running this
example does not trigger the state transitions either. This is what I
get upon starting the timeevent.lua FSM:

EXEC_PATH root.initial[C]->root.one[S]
TRANS_EXIT exiting all up to (including): root.initial , lca: root
EFFECT T={ src='root.initial', tgt='root.one', events='{}' }
TRANS_ENTER lca: root down_path: root.one
TIMEEVENT reset timevent e_after(1)@root.one cur:
4750085868.524us, end: 4751085868.524us
RAISED e_done [..] ...
STATE_ENTER root.one
TRANSITION searching transitions for events: e_done [..] ...
CHECKING depth: 0 for transitions from root
CHECKING depth: 1 for transitions from root.one
TRANSITION no enabled paths found
HIBERNATING no events, no idle_hook, no doos or doo idle, halting engines

It is using the rtt timing service, as mentioned during startup:

using RTT timing services
INFO: created undeclared connector root.initial
TIMEEVENT Expanding timeevents

I had to make one modification to the timeevent.lua file: the uml
module was not found, so I commented out that line (#34)
I'm using the latest master branch of rFSM (82e555) and OCL(1519e4)

Regards,

Steven

Lua timeevent functionality

On Mon, Nov 28, 2011 at 10:58:57AM +0100, Steven Bellens wrote:
> Hi,
>
> I'm trying to use the Lua timeevents to trigger a state transition
> after a couple of seconds have passed. I didn't get it to work with my
> app, so I'm trying the timeevent example now. However, running this
> example does not trigger the state transitions either. This is what I
> get upon starting the timeevent.lua FSM:
>
> EXEC_PATH root.initial[C]->root.one[S]
> TRANS_EXIT exiting all up to (including): root.initial , lca: root
> EFFECT T={ src='root.initial', tgt='root.one', events='{}' }
> TRANS_ENTER lca: root down_path: root.one
> TIMEEVENT reset timevent e_after(1)@root.one cur:
> 4750085868.524us, end: 4751085868.524us
> RAISED e_done [..] ...
> STATE_ENTER root.one
> TRANSITION searching transitions for events: e_done [..] ...
> CHECKING depth: 0 for transitions from root
> CHECKING depth: 1 for transitions from root.one
> TRANSITION no enabled paths found
> HIBERNATING no events, no idle_hook, no doos or doo idle, halting engines
>
> It is using the rtt timing service, as mentioned during startup:
>
> using RTT timing services
> INFO: created undeclared connector root.initial
> TIMEEVENT Expanding timeevents
>
> I had to make one modification to the timeevent.lua file: the uml
> module was not found, so I commented out that line (#34)
> I'm using the latest master branch of rFSM (82e555) and OCL(1519e4)

In the launch_fsm.lua configureHook example, can you change
the line

fsm.step_hook=rfsm_rtt.gen_write_fqn(fqn_out)

to

fsm.step_hook=utils.advise('before', fsm.step_hook, rfsm_rtt.gen_write_fqn(fqn_out))

and check if it works?

Essentially the gen_write_fqn function overwrites the timeevent
checking hook installed by the timevent module. Setting the step_hook
manually is deprecated, but I still have to define some conveniance
functions and update the docs...

Thanks for reporting.
Markys

Lua timeevent functionality

2011/11/28 Markus Klotzbuecher <markus [dot] klotzbuecher [..] ...>:
> On Mon, Nov 28, 2011 at 10:58:57AM +0100, Steven Bellens wrote:
>> Hi,
>>
>> I'm trying to use the Lua timeevents to trigger a state transition
>> after a couple of seconds have passed. I didn't get it to work with my
>> app, so I'm trying the timeevent example now. However, running this
>> example does not trigger the state transitions either. This is what I
>> get upon starting the timeevent.lua FSM:
>>
>> EXEC_PATH root.initial[C]->root.one[S]
>> TRANS_EXIT      exiting all up to (including):  root.initial    , lca:  root
>> EFFECT  T={ src='root.initial', tgt='root.one', events='{}' }
>> TRANS_ENTER     lca: root       down_path:      root.one
>> TIMEEVENT       reset timevent e_after(1)@root.one cur:
>> 4750085868.524us, end: 4751085868.524us
>> RAISED  e_done [..] ...
>> STATE_ENTER     root.one
>> TRANSITION      searching transitions for events: e_done [..] ...
>> CHECKING        depth:  0       for transitions from root
>> CHECKING        depth:  1       for transitions from root.one
>> TRANSITION      no enabled paths found
>> HIBERNATING     no events, no idle_hook, no doos or doo idle, halting engines
>>
>> It is using the rtt timing service, as mentioned during startup:
>>
>> using RTT timing services
>> INFO: created undeclared connector root.initial
>> TIMEEVENT       Expanding timeevents
>>
>> I had to make one modification to the timeevent.lua file: the uml
>> module was not found, so I commented out that line (#34)
>> I'm using the latest master branch of rFSM (82e555) and OCL(1519e4)
>
> In the launch_fsm.lua configureHook example, can you change
> the line
>
>  fsm.step_hook=rfsm_rtt.gen_write_fqn(fqn_out)
>
> to
>
>  fsm.step_hook=utils.advise('before', fsm.step_hook,  rfsm_rtt.gen_write_fqn(fqn_out))
>
> and check if it works?

Yup, this is working now!

Steven

>
> Essentially the gen_write_fqn function overwrites the timeevent
> checking hook installed by the timevent module. Setting the step_hook
> manually is deprecated, but I still have to define some conveniance
> functions and update the docs...
>
> Thanks for reporting.
> Markys
>

Ruben Smits's picture

Lua timeevent functionality

On Monday 28 November 2011 10:58:57 Steven Bellens wrote:
> Hi,
>
> I'm trying to use the Lua timeevents to trigger a state transition
> after a couple of seconds have passed. I didn't get it to work with my
> app, so I'm trying the timeevent example now. However, running this
> example does not trigger the state transitions either. This is what I
> get upon starting the timeevent.lua FSM:
>
> EXEC_PATH root.initial[C]->root.one[S]
> TRANS_EXIT exiting all up to (including): root.initial , lca: root
> EFFECT T={ src='root.initial', tgt='root.one', events='{}' }
> TRANS_ENTER lca: root down_path: root.one
> TIMEEVENT reset timevent e_after(1)@root.one cur:
> 4750085868.524us, end: 4751085868.524us
> RAISED e_done [..] ...
> STATE_ENTER root.one
> TRANSITION searching transitions for events: e_done [..] ...
> CHECKING depth: 0 for transitions from root
> CHECKING depth: 1 for transitions from root.one
> TRANSITION no enabled paths found
> HIBERNATING no events, no idle_hook, no doos or doo idle, halting
> engines
>
> It is using the rtt timing service, as mentioned during startup:
>
> using RTT timing services
> INFO: created undeclared connector root.initial
> TIMEEVENT Expanding timeevents
>
> I had to make one modification to the timeevent.lua file: the uml
> module was not found, so I commented out that line (#34)
> I'm using the latest master branch of rFSM (82e555) and OCL(1519e4)

Is the component running the lua fsm started?

> Regards,
>
> Steven