Event Sources and Realtime Actions

Slides:



Advertisements
Similar presentations
Lecture 10 Sharing Resources. Basics of File Sharing The core component of any server is its ability to share files. In fact, the Server service in all.
Advertisements

Real-Time Library: RTX
Introduction to Operating Systems – Windows process and thread management In this lecture we will cover Threads and processes in Windows Thread priority.
Chapter 13 Embedded Systems
Figure 1.1 Interaction between applications and the operating system.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 8: Implementing and Managing Printers.
1 I/O Management in Representative Operating Systems.
Slide 1 of 9 Presenting 24x7 Scheduler The art of computer automation Press PageDown key or click to advance.
Disk and I/O Management
Hands-On Microsoft Windows Server 2008
LOGO OPERATING SYSTEM Dalia AL-Dabbagh
1-1 Embedded Network Interface (ENI) API Concepts Shared RAM vs. FIFO modes ENI API’s.
Ihr Logo Operating Systems Internals & Design Principles Fifth Edition William Stallings Chapter 2 (Part II) Operating System Overview.
The Client-Server Model And the Socket API. Client-Server (1) The datagram service does not require cooperation between the peer applications but such.
Time Management.  Time management is concerned with OS facilities and services which measure real time.  These services include:  Keeping track of.
Embedded Computer - Definition When a microcomputer is part of a larger product, it is said to be an embedded computer. The embedded computer retrieves.
Module 5: Managing Content. Overview Publishing Content Executing Reports Creating Cached Instances Creating Snapshots and Report History Creating Subscriptions.
Active-HDL Server Farm Course 11. All materials updated on: September 30, 2004 Outline 1.Introduction 2.Advantages 3.Requirements 4.Installation 5.Architecture.
Tutorial 2: Homework 1 and Project 1
Real-time Software Design
The FESA Development Guideline
TANGO Harmonization Meeting (Edinburgh)
Project Management: Messages
Essentials of UrbanCode Deploy v6.1 QQ147
Module 12: I/O Systems I/O hardware Application I/O Interface
Chapter 13: I/O Systems Modified by Dr. Neerja Mhaskar for CS 3SH3.
Threaded Programming in Python
Chapter 2: Computer-System Structures
Lecture 1: Operating System Services
Resource Management IB Computer Science.
GPU Computing CIS-543 Lecture 10: Streams and Events
Working in the Forms Developer Environment
ERP & APO Integration Theories & Concepts
Section 13 - Integrating with Third Party Tools
Other Important Synchronization Primitives
Lecture 25 More Synchronized Data and Producer/Consumer Relationship
Distribution and components
Senior Software Engineering Student Robertas Sys
CS703 - Advanced Operating Systems
Use of Multiple Devices
Real-time Software Design
#01 Client/Server Computing
CSCI 315 Operating Systems Design
FESA 3.0 für Klassenentwickler: Erfahrungen und Erkenntnisse; Allgemeine Diskussion der Gerätemodellentwicklung
Chapter 2: The Linux System Part 2
I/O Systems I/O Hardware Application I/O Interface
Operating System Concepts
13: I/O Systems I/O hardwared Application I/O Interface
CS703 - Advanced Operating Systems
Introduction to Classes and Objects
Chapter 2: The Linux System Part 3
Exploring the Power of EPDM Tasks - Working with and Developing Tasks in EPDM By: Marc Young XLM Solutions
Multithreading.
Analysis models and design models
An Introduction to Software Architecture
Multithreaded Programming
Operating Systems : Overview
Implementation of EIDE Gateway using ACES Callouts
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Chapter 15: File System Internals
Chapter 3: Processes.
Chapter 4: Threads.
Operating Systems : Overview
Chapter 2: Computer-System Structures
Chapter 2: Computer-System Structures
Chapter 13: I/O Systems.
Module 12: I/O Systems I/O hardwared Application I/O Interface
#01 Client/Server Computing
and Forecasting Resources
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

Event Sources and Realtime Actions

Actions Fesa maintains strict separation of Server and Realtime parts Server Actions: Manage the client interface May only read acquisition data Triggered by middleware requests Realtime Actions Manage the hardware interface May write acquisition data Triggered by Events Events generated by Event Sources The Server and Realtime parts may run in separate executables The Realtime hardware interface can keep running if the middleware interface crashes

Data Consistency A data consistency mechanism ensures there is no conflict if a single data field is simultaneously read by a Server Action and written by a Realtime Action RollingBuffer size 2: Time RT Action Server GetAcquisition Action Hardware value into Buffer 0 1 Hardware value into Buffer 1 Read Buffer 0 2 Blocks Still Reading Buffer 0 3

Event Sources Source Cardinality Class specific Payload possible TimingEventSource (0..1) no yes TimerEventSource (0..1) no no CustomEventSource (0..n) yes yes OnDemandEventSource (0..n) yes yes OnSubscriptionEventSource (0..1) no yes Generated FESA class code Event (RealTime) Timer Timing (White Rabbit) Custom (Hardware) OnDemand (internal) OnSubscription Event (Server) Get Set Subscribe Unsubscribe Server Interface RT Scheduler C++ Code provided by the class developer Hardware Device Hardware Device Hardware Device

Event Source Types TimingEventSource Events defined by LSA and distributed by the White Rabbit timing system TimerEventSource Generates events at regular intervals, typically used to poll hardware CustomEventSource Allows hardware to trigger a Realtime Action OnDemandEventSource Allows a client to trigger a Realtime Action from a Server Action OnSubscriptionEventSource FESA classes may subscribe to other classes' Properties

Timing Event Source Timing Master distributes events and their scheduled execution time Timing Receivers match the events you are interested in Events are triggered at the scheduled time May have as many timing-events as the hardware supports Covered in detail in the next section

Timer Event Source Provides a software interval timers with configurable period (ms) Multiple timer events may be used Typically used to poll hardware for acquisition data Always present in class-design no payload

Event Lifetime Example: Timer Event TimerEventSource waits until a certain time is reached TimerEventSource generates an Event of a particular LogicalEvent type The Logical Event is e.g. ReadTemperature The Event is a single object and may carry a payload A Scheduling Unit assigned to that LogicalEvent type defines which Action(s) the Event will trigger The Event is queued and processed according to Scheduling Unit and Concurrency Layer rules An Action is triggered, allowing user code to act on the Event and any payload

Design Steps Design Deploy Unit Instance File Event Source Logical Events Actions Scheduling Units Deploy Unit Concurrency Layers: Assign Scheduling Units Threads and Processor Affinity Instance File Event Mapping: Linking Event Sources to Logical Events

Custom Event Source You may create your own event-source Typically used when the hardware drives the acquisition process Your code determines when an event is triggered Interrupts Callbacks Polling You may produce many custom-events in a custom-event-source

A Custom Timer The default behaviour is to block for a short time interval This gives an alternative way to build a Timer Event Source Design: Create a new FESA Class named EventSources and create the default deploy-unit

Custom Event Design Create a new real-time action using the RT Action Wizard Add a custom-event-source at events→sources The relevant sections of the design should be as shown

Custom Event Code After generating code you will have new files CustomTimerAction.cpp and CustomTimerEventSource.cpp Modify the Action to do something visible void CustomTimerAction::execute(fesa::RTEvent* pEvt) { std::cout << "Custom Timer Event" << std::endl; } void CustomTimerEventSource::wait(boost::shared_ptr<fesa::RTEvent>& eventToFire) // This code provides an example on how a custom-event-source can look like. struct timespec time; time.tv_sec = 1; // wake-up every 1 second time.tv_nsec = 0; // Your code should block until something interesting happens nanosleep(&time, &time); // Here you can create your own event by filling the eventToFire with the needed information. // Use the Event-Enumeration defined in the header file of this class! // Check the BaseClass of this class for more options! createEvent(eventToFire, CustomTimerEventSource::defaultEvent); // Once this method returns, the fesa-core will process our event and post it to all interested schedulers. // After that, this method will be called again.

Custom Event Configuration In the Deploy Unit: Add a scheduler Name the concurrency layer Add a scheduling unit and reference the one in the design Remove executable type server and replace with mixed Generate Code Add FEC (asl...) In the Instance File add an event configuration Under Custom Add CustomTimerEventSource (keep the defaultEvent) Use “Promote Instances” if events added to the design are not present in the instance file

Custom Event Execution Cd yourworkspace/EventSources_DU/src/test/asl73x ./startManually_EventSources_DU_M.sh Watch the events Use Promote Instances if events added to the design are not present in the instance file

OnDemandEventSource ServerAction triggers RTAction RTAction triggers RTAction any number of class-specific instances manual or automatic trigger payload TriggerOnDemandEventSource( MyOnDemandEventSource, context ); std::string payload = "myPayload"; TriggerOnDemandEventSource( MyOnDemandEventSource,context,payload.c_str(),payload.size() );

On Demand Event Source Goal: Allow a client to initiate a real-time action Using the Property Wizard create a command-property “Demand” Select default implementation for the SetDemandAction Create an on-demand-event-source DemandEventSource Start the RT Action Wizard to create: a Logical Event StartDemandEvent of type on-demand An Action StartDemandAction A Scheduling Unit Add a triggered-event-source to the SetDemand action referring to the On-demand event source DemandStartMeasurement

On Demand Event Source Goal: Initiate a real-time action Deploy: Mixed Executable Create a concurrency layer Add the scheduling unit Instance: Name the event-configuration measureOnDemand Name the Device In the device events-mapping, set the event-configuration-ref Start FESA Explorer and trigger the command property The Set action returns immediately The realtime action is triggered

Payloads Events carry a payload of type string. Realtime actions can check if an event carries a payload TriggerOnDemandEventSource( DemandEventSource, context ); std::string payload = "myPayload"; TriggerOnDemandEventSource( DemandEventSource,context,payload.c_str(),payload.size() );

Further Exercises Create acquisition data fields and a property to access them Use a payload to transfer data from server to RT

Event Payloads Use of Event Payloads Deploy: Mixed Executable Create a concurrency layer Add the scheduling unit Instance: Name the event-configuration measureOnDemand Name the Device In the device events-mapping, set the event-configuration-ref Start FESA Explorer and trigger the command property The Set action returns immediately The realtime action is triggered It could notify via subscription when completed

Enabling and Disabling Event Sources name of the logical-event service-locator of class Ex04 deprecated argument, can be ignored name of the event-source

OnSubscription Event Source → move to class reltionships FESA classes may subscribe to properties of other classes using the same middleware mechanism applications use An Event is triggered whenever the remote class notifies that there is new data The Event contains the data in its payload