EPICS

Channel Access Concepts
Kazuro Furukawa, KEK(Bob Dalesio, LANL)

Channel Access Concepts – IHEP EPICS Training – K.F – Aug.2001.

1

Why Channel Access?
◆We don’t have
Network transparent computing in general (yet)◆Plenty of administration tasks for sharing data◆

No standard way for remote processing
◆◆

EPICS

RPC, COM, CORBA, etc.

In EPICS, Channel Access provides
Efficient Software Bus on Network

Channel Access Concepts – IHEP EPICS Training – K.F – Aug.2001.

2

Channel Access :The EPICS Software Bus

EPICS

Operator Interface
Archive Tool
Alarm Tool
Application
ApplicationChannel Access Concepts – IHEP EPICS Training – K.F – Aug.2001.

3

Control Processing
Functionalities◆

On-demand Synchronous◆On-demand Asynchronous◆

Periodical◆

On-ChangeEPICS(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 – IHEP EPICS Training – K.F – Aug.2001.

4

What is Channel Access (CA)

EPICS

◆

Standardized communication path to a field(s) withina record (process variable) in any IOC database(s).

◆This field is a communication path to an IO channelor software.

◆Integrates software modules into the control system.

◆A callable interface (library of subroutines).

Channel Access Concepts – IHEP EPICS Training – K.F – Aug.2001.

5

Why Use Channel Access

EPICS

◆

Callable interface designed for easy use by casual applications◆

Callable interface also designed for use by system software
components such as the operator interface, sequencer, and thearchiver◆

Operating system transparency◆Network transparency(access to remote and local channels is identical)◆CPU architecture independence (silent data conversion)◆Isolation from system software changes.

◆Efficiency (host IO channels)◆Efficiency (network remote IO channels)

Channel Access Concepts – IHEP EPICS Training – K.F – Aug.2001.

6

EPICS

Channel Access networkarchitecture
Operator
Interface 1

...

CAC

Operator
Interface n
CAC

Data logger,
Data Analysis

CAC

CAC

CAC

IEEE 802.3

CAS

CAC

CAC
IO Controller 1CAC

CAS

CAS

...
IO Controller 2

IO Controller n

CAS Channel Access Server
CAC Channel Access Client
Channel Access Concepts – IHEP EPICS Training – K.F – Aug.2001.

7

Client Server ModelEPICS◆CA is a network service.

◆Clients use the callable interface (link to the CAlibrary).

◆Server replicated in each IOC (part of iocCore).

◆Clients make requests to the servers across thenetwork.

◆CA defines a network protocol.

◆Local operations are initiated and performed by thehost processor.

◆

Remote operations are initiated but not performed on
the host processor.

Channel Access Concepts – IHEP EPICS Training – K.F – Aug.2001.

8

Asynchronous Nature of CAEPICS◆

CA does not wait to gain access to the network prior toreturning from each library call.

◆Remote operation requests are buffered and sent when thebuffer fills or when you ask.

◆Data fetched from a remote machine is generally not
immediately available.

◆With few exceptions values written into your variables by
CA should not be referenced until you have synchronized.

◆All operations guaranteed to be executed in the orderrequested.

Channel Access Concepts – IHEP EPICS Training – K.F – Aug.2001.

9

Why is CA Asynchronous?

EPICS

◆

Combined operations are more efficient when sharing acommon resource such as a bus.

◆Combined operations can be more efficient when passingthrough system software layers.

◆Sometimes it is useful to perform labor on a local
processor while several operations are completing on
remote processors.

◆The plant is often asynchronous.

Channel Access Concepts – IHEP EPICS Training – K.F – Aug.2001.

10

CA Performance

EPICS

2000

microseconds

1800
1600

local access

1400

remote asynchronous access

1200

remote synchronous access

1000
800
600
400
200
0ReadsWritesSimple Unconverted I/O Channel Reads and Writes
Channel Access Concepts – IHEP EPICS Training – K.F – Aug.2001.

11

Methods of SynchronizingEPICS◆

No data fetches are left outstanding after completing acall to ca_pend_io().

◆Asynchronous replacement for ca_get():ca_get()ca_pend_io(),◆

Use a monitor.

◆Use fetch with callback.

◆Use a synch protocol with a remote program.

Channel Access Concepts – IHEP EPICS Training – K.F – Aug.2001.

12

Event Propagation

EPICS

◆

In any process control system, an application
program must be prepared to respond to any one of anumber of asynchronous events.

◆Events include hardware or software state changes(limit switches, flow indicators, out of range analogchannels, software exceptions, etc.)

Channel Access Concepts – IHEP EPICS Training – K.F – Aug.2001.

13

CA Software Interface to EventsEPICS◆

An event is a significant change in either the value ofa field or the condition of the record as a whole.

◆Events are placed in a queue and handled in theorder that they occurred.

◆A channel can be monitored by specifying a handler
to be run each time an event occurs.

◆CA client applications using events tend to be treestructured.

◆Updating the client’s local value for a channel thisway can save on network traffic since a message
soliciting the update need not be sent.

Channel Access Concepts – IHEP EPICS Training – K.F – Aug.2001.

14

Event Rate Management(Analog Channels)◆EPICS

The rate at which updates are sent over the network
should be minimized by the project engineer withinreasonable constraints. This rate is managed by adjusting
the channel’s deadband and scan rate.

Channel Access Concepts – IHEP EPICS Training – K.F – Aug.2001.

15

CA Exceptions

EPICS

◆

Since the CA client library does not wait to gain access tothe network prior to returning from each call an operation
can fail in the server after the library call that initiated itreturns.

◆Status of these unsuccessful operations are returned fromthe server to the client’s exception handler.

◆The default exception handler prints a message for each
unsuccessful operation and aborts the client if the conditionis severe.

◆Operations which fail in the server are nearly always
caused by programming errors.

Channel Access Concepts – IHEP EPICS Training – K.F – Aug.2001.

16

Channel Naming Convention◆CA requires that channels have a name.

◆The IOC database requires names of the form:◆EPICS<record name>[.<field name>]◆rfhv01.LOPR”◆“rfhv01”◆

Record names are assigned by project engineer following projectnaming convention.

◆Record field names and purposes are record type specific◆

A list of the field names available for each record can be obtained fromthe database documentation (EPICS Record Reference Manual.)◆

If the field name is omitted, the field .VAL is assumed. This field contains
a control or read back value.
Channel Access Concepts – IHEP EPICS Training – K.F – Aug.2001.

17

Native Data TypesEPICS◆

All channels have a “native” data storage type in the IOC.

◆All native data storage types are “atomic”.

◆Atomic data types include:◆integer, floating point, string, enumerated etc.

◆When transferring a new value to/from a channel theclient program specifies the data format to supply/receive
it in. This is often referred to as the external data type.

◆The external data type can be different from the nativetype if conversion is possible.

Channel Access Concepts – IHEP EPICS Training – K.F – Aug.2001.

18

Compound Data Types◆EPICS

Compound data types contain a channel value combinedwith additional status or configuration information.
◆Value + Alarm Status + Timestamp + Drive Limits◆

Compound types involve the database record as a whole.

◆Compound types can currently only be used with gets andmonitors.

◆Data types are described in db_access.h. (DBR_XXXX)Channel Access Concepts – IHEP EPICS Training – K.F – Aug.2001.

19

Connection ManagementEPICS◆

Network Connections are inherently transient.

◆A channel’s connection state is either not found,connected, or disconnected.

◆CA allows you to specify a handler to be run when achannel’s connection state changes.

◆Connection requires a server for the channel and a valid
network path to the server.

◆CA automatically restores connection upon notificationfrom the server.

Channel Access Concepts – IHEP EPICS Training – K.F – Aug.2001.

20

Software Releases

EPICS

◆

IOC core and CA client library EPICS major release
number must match, or client will not find sever.

◆This is due to potential CA protocol redesign between
major releases.

◆CA protocol is upwardly compatible within a major release.

◆When new features are added to the client, older versionsof the server won’t support them.

Channel Access Concepts – IHEP EPICS Training – K.F – Aug.2001.

21EPICSWORKSTATION
user program
Channel Access
Repeater

Channel AccessserverChannel AccessclientChannel Accessclientdatabase access library

C program
SNL sequence

DATABASE
database libraryrecord support
device support
device drivers
IOC
instrumentation
andcontrol hardware
Channel Access Concepts – IHEP EPICS Training – K.F – Aug.2001.

22