EPICS

Channel Access Configuration
Kazuro Furukawa, KEK(Andrew Johnson, APS, USPAS1999)

Channel Access Configuration – EPICS Training – K.F - Jul.2003.

1Configuration methoduu

EPICS

CA clients and servers can be configured by setting environment
variables
On Unix:
csh, tcsh — setenv VARNAME value
u sh, ksh — VARNAME=value;export VARNAME
u printenv displays all variables from any shelluu

On vxWorks:uuu

putenv "VARNAME=value"
envShow displays all variable values

Environment variables are inherited when you start a new program,not afterwards
Unix: Set the variables, then start the clientu vxWorks: Set variables in the startup scriptuu

Default values for a site are set at build-time in<epics>/base/config/CONFIG_ENV and<epics>/base/config/CONFIG_SITE_ENV

Channel Access Configuration – EPICS Training – K.F - Jul.2003.

2

CA name resolution
uu

Search requests for CA channel names are broadcast to all CA
servers on the client’s local TCP/IP subnet
Only a server which recognizes the name will respond to the clientuuu

EPICS

If identical record names exist in two IOCs, the first to reply “wins” theconnection

The client library then opens a connection with that server to accessthat channel
Potential problems:u

Not all LANs support broadcastinguu

Some sites don’t allow broadcastinguu

Ethernet does, Token Ring doesn’t
Bridges/hubs will not forward packets

Broadcasts are local to the machine’s subnet
uSites can span more than a single subnet

Channel Access Configuration – EPICS Training – K.F - Jul.2003.

3

Configuring name resolution
uEPICS

How to disable all broadcasts?
u

EPICS_CA_AUTO_ADDR_LIST = NODefault value = YES
u IOCs are also clients, so generate broadcastsuu

How to find channels without broadcast?
u

EPICS_CA_ADDR_LISTu

List of IP addresses, separated by spaces
setenv EPICS_CA_ADDR_LIST "164.54.8.145"

uuThis list is used in addition to broadcasts if these are enabled

How to search other subnets as well?
u

Use a broadcast address in EPICS_CA_ADDR_LIST
setenv EPICS_CA_ADDR_LIST "131.111.69.255"

uSome routers will not pass broadcast addresses

Channel Access Configuration – EPICS Training – K.F - Jul.2003.

4Connection healthu

CA servers send out an “I’m still here” beacon ever 15seconds
uuEPICS

Usually broadcast, configurable as before

If a server is quiet for 30 seconds, any connected clientswillsend it an “echo” packet (not broadcast)u allow 5 seconds for it to reply
u mark all channels to this server disconnecteduu

Potential problems:
Slow or busy links might introduce random delays, some longer
than 15 seconds
u Busy sites may want to reduce broadcast rates
u Clients take 35 seconds to recognize when a server has dieduChannel Access Configuration – EPICS Training – K.F - Jul.2003.

5Configuring connection
healthuu

EPICS

How to change the server beacon period?
uputenv "EPICS_CA_BEACON_PERIOD=30.0"

uDefault value is 15.0 seconds

How to change the client timeout delay?
usetenv EPICS_CA_CONN_TMO 60.0

Default value is 30.0 seconds
u This value determines how long a client takes to notice that aserver has died (+5 seconds)
uuThe connection timeout must be longer than the beacon
period, preferably twice
Breaking the ‘preferred’ condition could increase network traffic
u Breaking the ‘must be’ condition can also cause random clientdisconnections
uChannel Access Configuration – EPICS Training – K.F - Jul.2003.

6Port numbers
uEPICS

Channel Access uses two IP port numbers for its
communication (UDP and TCP)
EPICS_CA_SERVER_PORT
u Default is 5064
u EPICS_CA_REPEATER_PORT
u Default is 5065
uuBoth should be > 5000, check with sysadmins

The settings for a server and all its clients must be thesameu Using different port numbers can allow independentprojects to share a subnet without any danger of CA
name clashes
uCan also be used for application testingu No interaction is possible between projects
uChannel Access Configuration – EPICS Training – K.F - Jul.2003.

7

Where am I —What time is it?
uEPICS

An IOC gets Universal Coordinated Time from its boot host(UTC=GMT)uThis is converted to local time using the server’s value for
EPICS_TS_MIN_WESTuu

CA Servers report timestamp values using their local timezone
How to tell a client that the server is in a different timezone?
usetenv EPICS_TS_MIN_WEST -480
uuu

Default value is set by site manager (APS=360)

Gives server’s timezone in minutes relative to GMT; negative means eastof Greenwich

Daylight savings changes are hard-coded into the IOC software.
Changes may occur on the wrong date in some locations…

Channel Access Configuration – EPICS Training – K.F - Jul.2003.

8