--
HaraldBraeuning - 19 Mar 2009
Events, Actions and Schedules
Usually, a Fesa device is triggered by external events. On such events, real time (RT) actions are executed, which read out the hardware and store the data in the device data fields. Scheduling units bind the events to the real time actions.
Actions
First we add two RT actions named 'Acquire' and 'AcquireStatus' to the actions field of our design. The name of actions should always be verbs indicating the function of the action. An empty 'notified-property' field is automatically created. This field is optional and specifies the property which is notified, whenever the RT action is called. External programs like GUIs can subscribe to properties and will automatically recieve the new data, when the property is notified by the RT action. More than one 'notified-property' fields can be added to a single RT action. In out design, the 'Acquire' action notifies the 'Data' property and the 'AcquireStatus' action notifies the 'Status' property.
Events
Next we define the events on which our Fesa class should react. If you selected the empty design at the beginning, you have first to create the 'events' field for the 'standard-class'. In the 'events' field we create two 'logical-events' named 'AcquireEvent' and 'AcquireStatusEvent'. Their purpose is evident from the names. They are automatically created as timer event as indicated by the 'timer' field. This field can be replaced if necessary by other event types like 'user' event or a reference to a custom event source.
Scheduling
Finally we define the scheduling to bind the events and RT actions together. If you selected the empty design at the beginning, you have first to create the 'scheduling' field for the 'standard-class'. One empty scheduling unit is automatically created. The description field is optional but it is always good practice to use it. We name the first scheduling unit 'Acquire'. In the 'rt-action-ref' field we select the 'Acquire' RT action and under 'trigger' in the 'explicit-event-ref' we select the correspondiong 'AcquireEvent'. This bind the RT action 'Acquire' to the event 'AcquireEvent'. We then create a similar scheduling unit for the 'AcquireStatus' RT action and 'AcquireStatusEvent'.
This also concludes the design phase of our Fesa class.