Response Time for IEC 61499 Over Ethernet
Total Page:16
File Type:pdf, Size:1020Kb
Response Time for IEC 61499 over Ethernet Per Lindgren, Johan Eriksson, Marcus Lindner and Andreas Lindner David Pereira and Luís Miguel Pinho Luleå University of Technology CISTER / INESC TEC, ISEP Email:{per.lindgren, johan.eriksson, marcus.lindner, andreas.lindner}@ltu.se Email: {dmrpe, lmp}@isep.ipp.pt Abstract—The IEC 61499 standard provides means to specify general purpose usage. Our results are safe to the worst case, distributed control systems in terms of function blocks. The while further improvements can be obtained if the Maximum execution model is event driven (asynchronous), where triggering Transmission Unit (MTU) of general purpose (best effort events may be associated with data (and seen as a message). traffic) is controlled. In this paper we propose a low complexity implementation technique allowing to assess end-to-end response time of event We can conclude that the presented approach reduces chains spanning over a set of networked devices. In this paper we complexity of distribution (in comparison to the traditional develop a method to provide safe end-to-end response time taking SCADA approach), reduces device and network complexity both intra- and inter-device delivery delays into account. As a (does neither require complex time triggered architectures use case we study the implementation onto (single-core) ARM- like scan based PLCs, nor any dedicated network compo- cortex based devices communicating over a switched Ethernet network. For the analysis we define a generic switch model and nents/protocols), and is highly flexible (allowing network shar- an experimental setup allowing us to study the impact of network ing between real-time and best-effort devices). Moreover, the topology as well as 802.1Q quality of service in a mixed critical presented approach opens up for the possibility to automate the setting. Our results indicate that safe sub millisecond end-to-end generation of interfaces (SIFBs) interconnecting FB networks, response times can be obtained using the proposed approach. for which correct-by-construction data delivery can be ensured. Moreover automation would allow the designer to focus on I. INTRODUCTION properties of the application at model level, independent on networking and deployment specifics. Traditional SCADA control systems typically imply the use of costly PLCs communicating over field buses, such as legacy Modbus[1]/PROFIBUS[2] and the more recent Ethernet based II. BACKGROUND POWERLINK[3], EtherCAT[4] and PROFINET[2] buses. In A. Task and Resource model order to establish end-to-end timing behaviour much attention has in general to be paid to the control system design, parti- The task and resource model undertaken for this presenta- tioning, and deployment. In this paper we take an alternative tion follows that of the Stack Resource Policy (SRP) [7]. For approach based on the recent IEC 61499 standard [5]. this presentation we use task instance and task interchangeably. In short the SRP task and resource model is captured in the In contrast to the traditional scan (time triggered) based following: PLC behaviour (as implied by the IEC 61131 standard [6]), the IEC 61499 undertakes an event triggered (asynchronous) • ti is a task with run to completion semantics, execution model. In the presented work we exploit the benefits of asynchronous execution both at device and network layer. • p(ti) is the static priority for ti used for scheduling, In particular asynchronous execution allows at device level • e is an event triggering the execution of the corre- preemptive execution of the function block network, and at i sponding task t , network layer, asynchronous communication over standard i Ethernet (with optional 802.1Q quality of service) frames, as • rj defines a resource, a task may claim resources in a implemented in Commercial Off-The-Shelf (COTS) as well as LIFO nested manner. rugged (industrial) Ethernet switches. In order to establish safe end-to-end timing properties of distributed IEC 61499 models, SRP provides pre-emptive, deadlock free, single-core the presented work covers the execution model, requirements scheduling for systems with shared resources (in this context, for the per device scheduling, a generic Ethernet switch model, claiming a resource can be seen as entering a critical section). and impact of general purpose traffic. This allows us to reason Given WCETs for the tasks and their inner claims, response on timing properties under different network topologies, link time analysis is readily available[7]. speeds, and quality of service configurations. The RTFM-kernel has been developed from the outset of Our results indicate that the proposed approach is capable the SRP task and resource model [8]. The kernel API amounts of safe sub millisecond end-to-end response times even using to C code macros, with predicable and low overhead (typically cost efficient COTS components. In particular, we show that, a few machine instructions onto the ARM-Cortex family of given the assumption switches implement predictable 802.1Q processors). It extends the task model with the ability to quality of service, the impact of non-critical traffic can be emit events (hence task chains can be expressed). Under the bound, and safe response times obtained. This allows for common assumption that the inter-arrival of triggering events flexible deployment, where the same physical network is is larger than the associated task response time, each task can shared in between the timing critical control applications and be associated with an interrupt handler, the underlying interrupt 1 hardware can be exploited as (a single unit) event buffer , and the execution b1 and b3 enters a named critical section r critical sections can be enforced through interrupt masking. In in order to get exclusive access of the shared resource (in such a way the actual scheduling is performed by the interrupt this case a data structure). This corresponds to the sequential hardware at a large. behaviour of the ECC in b1_b3. While each link in -core is treated as message (i.e., event with associated data) there is no B. IEC 61499 to RTFM-core Task and Resource model need for explicit data wiring, and multiplexing (F_MUX_2_1) rendering a succinct model. In previous work, a mapping from device/resource level IEC 61499 models have been proposed [9]. At the edges of e a1 a b b the IEC 61499 resources, Service Interface Blocks (SIFBs) are 1 1 2 required for inter resource communication. The IEC 61499 standard does not cover the implementation of SIFBs. For this r work we propose RTFM-core as the means of implementation. a b This brings the advantage that the complete system (at device 2 3 level) can be implemented in a uniform manner, allowing the SIFBs to be part of the device level scheduling without introducing any additional/external run-time system. ec c c 1) System model example: 1 1 2 a) IEC 61499 System model: Figure 1 depicts an Figure 3. Example RTFM system model. We have the (external) events ea1 IEC 61499 model developed in the 4DIAC IDE [10]. The and ec1 , triggering the task chains headed by a1 and c1 respectively. Tasks SIFB instances Ea1 and Ec1 capture the external events and b1 and b3 share a resource under the protection of a critical section r. trigger the execution of actions associated to a_1.i_1 and c_1.i_1 respectively. Figure 2 depicts the ECC of b1_b3, C. Monolithic single-core deployment showing the associated actions taskb1 for input event i1 and taskb3 for input event i3 respectively. For deployment onto single-core platforms, the rtfm-compiler derives the task set from the input program and performs SRP analysis (i.e., derives the resource ceilings on basis of the per-task resource utilisation). The generated code compiled together with the (target specific) RTFM-kernel primitives render an executable for the deployment. The kernel primitives implement the SRP scheduling policy by exploiting the underlying interrupt hardware. (For the ARM-Cortex family of processors, the scheduling overhead is bound to a few clock cycles [8].) Given Worst Case Execution Time (WCET) for tasks (and their critical sections) we can deploy available SRP based methods for deriving per task response times [7]. 1) Monolithic response times: The end-to-end response times for a task chain can be safely estimated by accumulating the response times along the chain. E.g., for the example sys- Figure 1. Example IEC 61499 system model. tem the response time of the task chain ea1 ! a1 ! b1 ! b2 is given as rt(a1) + rt(b1) + rt(b2). D. Ethernet technology Ethernet based buses are emerging in industrial applications as a cost and performance efficient alternative to proprietary field buses. Figure 2. ECC of FB b1_b2. In the following we briefly review a set common topolo- gies. (Messages in the figures relate to the distribution example b) RTFM System model: Figure 3 depicts an example later introduced, Section III.) Figure 4 depicts point to point RTFM system model expressing the same behaviour as the topologies. In legacy systems, a single coaxial cable was used example model from Figure 1. (left in Figure 4), using a collision detection and resend mech- anism, for which bound transmission times are hard/impossible In RTFM-core the system is expressed in terms of event to guarantee. Alternatively, collision free communication is triggered tasks with named critical sections. The external possible by using multiple interfaces and dedicated (point to event ea1 triggers the execution of a1, which in turn triggers point) cabling, however such solutions are costly and bulky the execution of b1, which in turn trigger b2. For part of (right in Figure 4). 1The 1-buffer assumption can be relaxed by user defined buffers, for which A switched (full duplex) star (single layer) network map- error handling semantics can be tailored to the application.