How to trigger a RT-Action form a server set-action?
Setting a property should trigger a specific real-time action
FESA 5.0.2, Eclipse plugin 2.9.9, (31.07.2019)
- in the design
- events->add child: sources (maybe have to create events node first)
- events->sources-> add child: on-demand (name = My_on_demand_source)
- events->logical-events-> add child: logical event (name = My_on_demand_logical_event, type = on-demand)
- actions->set-server-action-> add child: triggered-event-source (on-demand-event-source = My_on_demand_event_source)
- scheduling-units-> add child: scheduling unit (name = My_on_demand_scheduling_unit, rt-action-ref = My_on_demand_rt_action, logical_event_ref = My_on_demand_logical_event)
- validate & synchronize
- edit My_on_demand_rt_action.cpp to do something
- alternatively the above steps can be done via using the rt-action wizard:
- Select wizard: "Insert RT"
- Inser rt
- Logical event name: My_on_demand_logical_event
- Logical event type: on-demand
- Rt action name: My_on_demand_rt_action
- Scheduling unit name: My_on_demand_scheduling_unit
- Add triggered On-demand Event Source
- On-demand Event Source Name: My_on_demand_event_source
- choose triggering actions: select the set action
in the deploy file
- in the instance file: (first synchronize the source code form the design)
- classes->CLASSNAME->events-mapping-> add child: My_on_demand_logical_event
- classes->CLASSNAME->events-mapping->My_on_demand_logical_event-> add child: event-configuration (name = My_on_demand_event_config)
- !!! It can happen that the event-configuration gets a child called "Timer" when it actually should be "OnDemand", fix: replace "Timer" with "OnDemand" and make sure it has the correct on-demand-event-source-ref !!!
- classes->CLASSNAME->device-instance->events-mapping-> add child: My_on_demand_logical_event (event-config-ref = My_on_demand_event_config)
- prio-managment->classes->CLASSNAME-> add child: on-demand-event-sources
- ?? Add the Event-srouce to prio-managment->classes->CLASSNAME->on-demand-event-sources ?? does not work always !?! In the xml design view, the new EventSrouce is not listed when trying to add it as child. ... however, this seems to happen only when the instance file is edited before the deploy file.
- IMPORTANT This has to be done for every instance that should use the new events. If you use a different instance file with the event mapping missing, there will be no error or hint that something is missing, but the event will not fire at runtime!
- the same recipe can be used to create a new eventSource that triggers an already existing RT-Action. However, it is not clear how to use the wizard in that case. One can create a new RT-Action via the wizard just to delete it afterwards, but what else has to be adjusted?
- the wizard may add a triggered-event-source to the generated rt-action that triggers the on-demand-event-source that triggers the rt-action, as a result the rt-action is executed infinitely once triggered
- FIX: remove the triggered-event-source from the rt-action
- 15 Oct 2018