EPICS Channel Access Concepts Kazuro Furukawa KEK 2000

  • Slides: 23
Download presentation
EPICS Channel Access Concepts Kazuro Furukawa, KEK, (2000 -2004) <kazuro. furukawa @ kek. jp>

EPICS Channel Access Concepts Kazuro Furukawa, KEK, (2000 -2004) <kazuro. furukawa @ kek. jp> (Bob Dalesio, LANL, USPAS 1999) (Andrew Johnson, APS, USPAS 2003) Channel Access Concepts – EPICS Training – K. Furukawa – Mar. 2004. 1

Why Channel Access? u We don’t have Network transparent computing in general (yet) u

Why Channel Access? u We don’t have Network transparent computing in general (yet) u u Plenty of administration tasks for sharing data No standard way for remote processing u u EPICS RPC, COM, CORBA, RMI, . NET, etc. In EPICS, Channel Access provides Efficient Software Bus on Network Performance, Rapid development, Maintenance, Administration Tuned for each operating system (But no internal documentation yet) Channel Access Concepts – EPICS Training – K. Furukawa – Mar. 2004. 2

EPICS Provides Interfaces at All Levels Archive Viewing Archive Analysis User Tools DM/MEDM/DM 2

EPICS Provides Interfaces at All Levels Archive Viewing Archive Analysis User Tools DM/MEDM/DM 2 K/EDM/JDM Alarm Handler / strip. Tool/ knob. Manager Connection Server Archive Access Archiving Channel Access Client (CAC) Connection Data Transfers EPICS Program Interfaces C, C++, Fortran, JAVA IDL / Matlab / Mathematica Active. X / DDE / Vis. Basic SDDS / SAD / tcl / PERL / Python State Notation Lang / FSQT WAN/Local Connection Data Transfers Channel Access Server (CAS) DB Engine Types Connection Data Transfers Portable Channel Access Server (CAS) Generic Data Descriptor Access Lib Active X Channel Access Client Gateway Any Data Store Portable CAS Labview / Excel. . PCAS - Windows Device Support Driver Support I/O Controller Channel Access Concepts – EPICS Training – K. Furukawa – Mar. 2004. 3

Channel Access : The EPICS Software Bus EPICS Operator Interface Archive Tool Alarm Tool

Channel Access : The EPICS Software Bus EPICS Operator Interface Archive Tool Alarm Tool Application Channel Access Concepts – EPICS Training – K. Furukawa – Mar. 2004. 4

Control Processing Functionalities u u On-demand Synchronous On-demand Asynchronous Periodical On-Change u u u

Control Processing Functionalities u u On-demand Synchronous On-demand Asynchronous Periodical On-Change u u u EPICS (with value deadband) (with rate limit) On-Event (Trigger) Cache List of Control Points Static Information and History using the Same API Existent Control Systems Support a Part of Those Channel Access Concepts – EPICS Training – K. Furukawa – Mar. 2004. 5

What is Channel Access (CA) EPICS u Standardized communication path to a named data

What is Channel Access (CA) EPICS u Standardized communication path to a named data in a Channel Access server, usually a field within a record (process variable) in any IOC database. u This data is a communication path to/from a hardware IO channel or other software. u Integrates software modules into the control system. u A callable interface (library of subroutines). Channel Access Concepts – EPICS Training – K. Furukawa – Mar. 2004. 6

Why Use Channel Access EPICS u Callable interface designed for easy use by casual

Why Use Channel Access EPICS u Callable interface designed for easy use by casual applications u Callable interface also designed for use by system software components such as the operator interface, sequencer, and the archiver u Operating system transparency u Network transparency (access to remote and local channels is identical) u CPU architecture independence (silent data conversion) u Isolation from system software changes. u Efficiency (host IO channels) u Efficiency (network remote IO channels) Channel Access Concepts – EPICS Training – K. Furukawa – Mar. 2004. 7

EPICS Channel Access network architecture Operator Interface 1 . . . CAC Operator Interface

EPICS Channel Access network architecture Operator Interface 1 . . . CAC Operator Interface n CAC Data logger, Data Analysis CAC CAC IEEE 802. 3 CAS CAC CAS . . . IO Controller 1 IO Controller 2 IO Controller n CAS Channel Access Server CAC Channel Access Client Channel Access Concepts – EPICS Training – K. Furukawa – Mar. 2004. 8

Client Server Model EPICS u CA is a network service. u Clients use the

Client Server Model EPICS u CA is a network service. u Clients use the callable interface (link to the CA library). u Server replicated in each IOC (part of ioc. Core). u Clients make requests to the servers across the network. u CA defines a network protocol. u Local operations are initiated and performed by the host processor. u Remote operations are initiated but not performed on the host processor. Channel Access Concepts – EPICS Training – K. Furukawa – Mar. 2004. 9

Asynchronous Nature of CA EPICS u CA does not wait to gain access to

Asynchronous Nature of CA EPICS u CA does not wait to gain access to the network prior to returning from each library call. u Remote operation requests are buffered and sent when the buffer fills or when you ask. u Data fetched from a remote machine is generally not immediately available. u With few exceptions values written into your variables by CA should not be referenced until you have synchronized. u All operations guaranteed to be executed in the order requested. Channel Access Concepts – EPICS Training – K. Furukawa – Mar. 2004. 10

Why is CA Asynchronous? EPICS u Combined operations are more efficient when sharing a

Why is CA Asynchronous? EPICS u Combined operations are more efficient when sharing a common resource such as a bus. u Combined operations can be more efficient when passing through system software layers. u Sometimes it is useful to perform labor on a local processor while several operations are completing on remote processors. u The plant is often asynchronous. Channel Access Concepts – EPICS Training – K. Furukawa – Mar. 2004. 11

CA Performance Reads EPICS Writes Simple Unconverted I/O Channel Reads and Writes Channel Access

CA Performance Reads EPICS Writes Simple Unconverted I/O Channel Reads and Writes Channel Access Concepts – EPICS Training – K. Furukawa – Mar. 2004. 12

Methods of Synchronizing u EPICS No data fetches are left outstanding after completing a

Methods of Synchronizing u EPICS No data fetches are left outstanding after completing a call to ca_pend_io(). u Asynchronous replacement for ca_get(): ca_get() ca_pend_io() u Use a monitor. u Use fetch with callback. u Use a synch protocol with a remote program. Channel Access Concepts – EPICS Training – K. Furukawa – Mar. 2004. 13

Event Propagation EPICS u In any process control system, an application program must be

Event Propagation EPICS u In any process control system, an application program must be prepared to respond to any one of a number of asynchronous events. u Events include hardware or software state changes (limit switches, flow indicators, out of range analog channels, software exceptions, etc. ) Channel Access Concepts – EPICS Training – K. Furukawa – Mar. 2004. 14

CA Software Interface to Events EPICS u An event is a significant change in

CA Software Interface to Events EPICS u An event is a significant change in either the value of a field or the condition of the record as a whole. u Events are placed in a queue and handled in the order that they occurred. u A channel can be monitored by specifying a handler to be run each time an event occurs. u CA client applications using events tend to be tree structured. u Updating the client’s local value for a channel this way can save on network traffic since a message soliciting the update need not be sent. Channel Access Concepts – EPICS Training – K. Furukawa – Mar. 2004. 15

Event Rate Management (Analog Channels) EPICS u The rate at which updates are sent

Event Rate Management (Analog Channels) EPICS u The rate at which updates are sent over the network should be minimized by the project engineer within reasonable constraints. This rate is managed by adjusting the channel’s deadband scan rate. u (R 3. 15 may provide facility to limit monitor rate (? )) Channel Access Concepts – EPICS Training – K. Furukawa – Mar. 2004. 16

CA Exceptions EPICS u Since the CA client library does not wait to gain

CA Exceptions EPICS u Since the CA client library does not wait to gain access to the network prior to returning from each call an operation can fail in the server after the library call that initiated it returns. u Status of these unsuccessful operations are returned from the server to the client’s exception handler. u The default exception handler prints a message for each unsuccessful operation and aborts the client if the condition is severe. u Operations which fail in the server are nearly always caused by programming errors. Channel Access Concepts – EPICS Training – K. Furukawa – Mar. 2004. 17

Channel Naming Convention u CA requires that channels have a name. u The IOC

Channel Naming Convention u CA requires that channels have a name. u The IOC database requires names of the form: u EPICS <record name>[. <field name>] u rfhv 01. LOPR” u “rfhv 01” u Record names are assigned by project engineer following project naming convention. u Record field names and purposes are record type specific u A list of the field names available for each record can be obtained from the database documentation (EPICS Record Reference Manual. ) u If the field name is omitted, the field. VAL is assumed. This field contains a control or read back value. Channel Access Concepts – EPICS Training – K. Furukawa – Mar. 2004. 18

Native Data Types EPICS u All channels have a “native” data storage type in

Native Data Types EPICS u All channels have a “native” data storage type in the IOC. u All native data storage types are “atomic”. u Atomic data types include: u integer, floating point, string, enumerated etc. u When transferring a new value to/from a channel the client program specifies the data format to supply/receive it in. This is often referred to as the external data type. u The external data type can be different from the native type if conversion is possible. Channel Access Concepts – EPICS Training – K. Furukawa – Mar. 2004. 19

Compound Data Types u EPICS Compound data types contain a channel value combined with

Compound Data Types u EPICS Compound data types contain a channel value combined with additional status or configuration information. u Value + Alarm Status + Timestamp + Drive Limits u Compound types involve the database record as a whole. u Compound types can currently only be used with gets and monitors. u Data types are described in db_access. h. (DBR_XXXX) Channel Access Concepts – EPICS Training – K. Furukawa – Mar. 2004. 20

Connection Management EPICS u Network Connections are inherently transient. u A channel’s connection state

Connection Management EPICS u Network Connections are inherently transient. u A channel’s connection state is either not found, connected, or disconnected. u CA allows you to specify a handler to be run when a channel’s connection state changes. u Connection requires a server for the channel and a valid network path to the server. u CA automatically restores connection upon notification from the server. Channel Access Concepts – EPICS Training – K. Furukawa – Mar. 2004. 21

Software Releases EPICS u IOC core and CA client library EPICS major release number

Software Releases EPICS u IOC core and CA client library EPICS major release number must match, or client will not find server. u This is due to potential CA protocol redesign between major releases. u CA protocol is upwardly compatible within a major release. u When new features are added to the client, older versions of the server won’t support them. Channel Access Concepts – EPICS Training – K. Furukawa – Mar. 2004. 22

EPICS WORKSTATION (OPI) user program Channel Access Repeater Channel Access server Channel Access client

EPICS WORKSTATION (OPI) user program Channel Access Repeater Channel Access server Channel Access client database access library C program SNL sequence DATABASE database library record support device drivers IOC instrumentation and control hardware Channel Access Concepts – EPICS Training – K. Furukawa – Mar. 2004. 23