72
EPICS Training @ PSI Controls Section PSI 2015

EPICS Training @ PSI

  • Upload
    jacqui

  • View
    87

  • Download
    0

Embed Size (px)

DESCRIPTION

EPICS Training @ PSI. Controls Section PSI 2014. Acknowledgment. Some slides in this talk came form the „Getting started with EPICS“ lecture series of APS. My special thanks go to Ned Arnold and John Maclean from the Advanced Photon Source. The original talks can be found on - PowerPoint PPT Presentation

Citation preview

Page 1: EPICS Training @ PSI

EPICS Training @ PSI

Controls Section PSI

2015

Page 2: EPICS Training @ PSI

EPICS Training @ PSI

Acknowledgment

Some slides in this talk came form the

„Getting started with EPICS“ lecture series of APS.

My special thanks go to

Ned Arnold

and

John Maclean

from the Advanced Photon Source.

The original talks can be found on

www.aps.anl.gov/epics/docs/GSWE.php

Page 3: EPICS Training @ PSI

EPICS Training @ PSI

Contents

• What is EPICS• The Parts of EPICS• What are Records• An Example for a Record• How to Solve Problems with EPICS

Page 4: EPICS Training @ PSI

EPICS Training @ PSI

What is an Accelerator Control System?

The Accelerator Control System connects the Operator in the control room with the accelerator hardware. The control room might not be near the accelerator

Our Control System

is called EPICS

?EPICS

Accelerators

Operator

Page 5: EPICS Training @ PSI

What does EPICS Control?

EPICS Training @ PSI

For example Swiss Light Source (SLS at PSI) Accelerator components to control:

ca. 200 computersca. 600 magnets (+power supplies)300 vacuum pumps9 cavity structuresca. 150 beam position monitors

21 beamlines (together)ca. 300 computers10 undulator magnetsmore than 1200 motors

Distances between components (storage ring with 130 m diameter): 50 km power cable and more than 500 km signal cable

Page 6: EPICS Training @ PSI

EPICS Training @ PSI

What is EPICS?

EPICS is:• A collaboration• A software tool kit• A control system architecture

EPICS is an abbreviation for:Experimental Physics and Industrial Control System

EPICS:• supports distributed control systems for large research facilities like accelerators• uses Client/Server and Publish/Subscribe methods• uses the Channel Access (CA) network protocol

EPICS

Page 7: EPICS Training @ PSI

EPICS Training @ PSI

The History

–In1989 started a collaboration between Los Alamos National Laboratory (GTA) and Argonne National Laboratory (APS)

(Jeff Hill, Bob Dalesio & Marty Kraimer)

–More than 150 licenses agreements were signed, before EPICS became Open Source in 2004

–Team work on problems, for example over “Tech Talk” mailing list

–Two collaboration meetings every year (spring and autumn) in turns in America, Asia, and Europe

–Collaborative efforts vary • Assistance in finding bugs

• Share tools, schemes, and advice

GTA: Ground Test AcceleratorAPS: Advanced Photon Source

Page 8: EPICS Training @ PSI

EPICS Training @ PSI

EPICS – Who is Using That?

Some members of the collaboration (not complete!): – ANL (APS Accelerator, APS Beamlines, IPNS) in Chicago, USA– LANL in Los Alamos, USA– ORNL (SNS) in Oak Ridge, USA– SLAC (SSRL, LCLS) in Standford, USA– JLAB (CEBAF) in Newport, USA– DESY in Hamburg, Deutschland– BESSY in Berlin, Deutschland– PSI (SLS, HIPA, PROSCAN, SwissFEL) in Villigen, Schweiz– KEK in Tsukuba, Japan– DIAMOND Light Source (Rutherford Appleton Laboratory) in

Oxfordshire, England– Iter (Test Fusion Power Plant), South France– ESS (European Spallation Source), Lund, Sweden

Page 9: EPICS Training @ PSI

EPICS Training @ PSI

Are There Alternatives to EPICS?System Name:

• EPICS• TANGO

• DOOCS• Tine• ACS

• PVSS(Cern)

Pro:Bugs are already found

Contra:Complicated to adaptto your problems

Pro:Your problems solvedperfectly

Contra:You are on your own(no one can help)

Pro:Outsource your problems

Contra:Expensive

Collaborations:Used at more than one Lab

Single Site Systems:Developed and used in one Lab

Commercial System

Page 10: EPICS Training @ PSI

EPICS Training @ PSI

The Architecture of EPICS

A Server provides information and service

A Client uses the service or asks for the information

• For EPICS, client and server refer to their Channel Access role: i.e. Channel Access Client and Channel Access Server

• This standard control system architecture is often called

3 tier architecture or 3 layer model

Network based Client/Server Model (hence the EPICS logo):

EPICSClient

CAClient

CA

ServerCA

ServerCA

Page 11: EPICS Training @ PSI

EPICS Training @ PSI

What is Channel Access?• A protocol how to transfer data over network• A single data unit is called Process Variable• A Process Variable has a unique name, which is used to refer to the

data (Naming convention needed!)• The detailed operation of Channel Access is unimportant for most

programmers (it already works…)• Channel Access is not dependent on a single programming language

(native library in C/C++, Java, and C# available)• The entire set of Process Variables establish a Distributed Real-time

Database of machine status, information and control parameters

Process

Variables

CAS

Process

Variables

CAS

Process

Variables

CAS CAS

Process

Variables

CASCAS

Process

Variables

CAS

EPICS Database

Page 12: EPICS Training @ PSI

EPICS Training @ PSI

Channel Access Network Flow

CA Client

CA Server 1 CA Server 2 CA Server 3

Network

1. Query: Broadcast

2. Answer: direct connection

3. All further queries and answers work directly (Point-To-Point)

Page 13: EPICS Training @ PSI

EPICS Training @ PSI

Channel Access Commands

Process Variables:

Channel Access Server

S1A:H1:CurrentAO

S1:P1:x

S1:P1:y

S1:G1:vacuum

Channel Access ClientWho has a PV named “S1A:H1:CurrentAO”?

I do.

What is its value?

25.5 AMPS

Change its value to

30.5

“connection request” or

“search request”

OK, it is now 30.5

30.5 is too high. It is now set to the

maximum value of 27.5.

You are not authorized to

change this value

Notify me when the value changes

It is now 20.5

AMPS

It is now 10.5

AMPS

It is now 0.0023 AMPS

“put” or

“caput”

“get”

or

“caget”

“set a monitor”

“post an event”

or

“post a monitor”

“put complete”

or

or

CA Server

CA Client

Page 14: EPICS Training @ PSI

EPICS Training @ PSI

How is it Done?

Power Supply

Beam Position Monitor

Vacuum Gauge

Computer Interface

Computer Interface

Computer Interface

Process Variables:

Channel Access Server

S1A:H1:CurrentAO

S1:P1:x

S1:P1:y

S1:G1:vacuum

Channel Access Client

Channel Access Client

Channel Access Client

Network (Channel Access Protocol)

Machine

Operator

Page 15: EPICS Training @ PSI

EPICS Training @ PSI

What is EPICS - Conclusion

• EPICS is a control system architecture• EPICS is the connection between accelerator

and operator• EPICS is based on a transfer protocol named

Channel Access• Channel Access works with data sets called

Process Variables• EPICS is used by many institutes all over the

world

Page 16: EPICS Training @ PSI

EPICS Training @ PSI

Contents

• What is EPICS• The Parts of EPICS• What are Records• An Example for a Record• How to Solve Problems with EPICS

Page 17: EPICS Training @ PSI

EPICS Training @ PSI

Ou

tpu

t

In

pu

t

CA Server IOC

Control Room

CA Client CA Client

CA ServerServer Programs:(user programs)

Realtime Control

Records

Client Programs:alarmhandler

Striptool, caQtDM,many more …

(user programs)

Cannel Access:(UDP/TCP)

4th Layer

Hardware: maybe

controllers and PLCs

Parts of EPICS

Page 18: EPICS Training @ PSI

• VME is an abbreviation for VERSAmodule Eurocard

• Industry Computer • Developed since 1980 • It is not a PC• Real-time capable (i.e. delays are calculable)• Operating system was VxWorks from Wind River

company – will be real time Linux (at PSI)• Very expensive

(search for new solutions in EPICS community)

EPICS Training @ PSI

VME Computer

Page 19: EPICS Training @ PSI

EPICS Training @ PSI

What is an IOC?

• A special CA Server and CA Client (IOCs can “talk” to each other)

• A computer running the “IOC Core” program (at least once)

• This computer may be:- VME based, operating system vxWorks (only possibility for old EPICS

Versions up to 3.14), Linux, RTEMS- PC, operating system Windows, Linux, RTEMS- Apple, operating system OSX- UNIX Workstation, operating system Solaris

• An IOC normally is connected to input and/or output hardware (otherwise called softIOC)

• An IOC runs a record database, which defines what this IOC is doing

IOC meansInput Output Controller

Page 20: EPICS Training @ PSI

EPICS Training @ PSI

Some CA Clients

(from the EPICS Website - incomplete)•ALH: Alarm Handler •BURT: Backup and Restore Tool •CASR: Host-based Save/Restore •CAU: Channel Access Utility •Channel Archiver (SNS) •Channel Watcher (SLAC) •EDM: Extensible Display Manager (ORNL) •JoiMint: Java Operator Interface and Management INtegration Toolkit (DESY) •Knobs: Knob Manager und KnobConfig, eine Schnittstelle zu SunDials •MEDM: Motif Editor und Display Manager •StripTool: Strip-chart Plotting Tool •Command line tools (caget, caput, …)•and many more …

Page 21: EPICS Training @ PSI

EPICS Training @ PSI

Client Program: Command Line Tools• Read a PV named <NAME>

caget NAME

• Write a PV named <NAME>

caput NAME value

• Get information about that Record

cainfo NAME

• Start a monitor

camonitor NAME (Cancel with [Ctrl] + [c])

>caget ARIDI-PCT:CURRENTARIDI-PCT:CURRENT 350.56>

>caput ARIDI-PCT:CURRENT 401.5Old: ARIDI-PCT:CURRENT 350.56New: ARIDI-PCT:CURRENT 401.5>

>cainfo ARIDI-PCT:CURRENTARIDI-PCT:CURRENT State: connected Host: sls-cagw-1 Access: read, no write Data type: DBR_DOUBLE Element count: 1>

>camonitor ARIDI-PCT:CURRENTARIDI-PCT:CURRENT 250.542ARIDI-PCT:CURRENT 250.537ARIDI-PCT:CURRENT 250.533ARIDI-PCT:CURRENT 250.525>

Page 22: EPICS Training @ PSI

EPICS Training @ PSI

Some CA Clients

(from the EPICS Website - incomplete)•ALH: Alarm Handler •BURT: Backup and Restore Tool •CASR: Host-based Save/Restore •CAU: Channel Access Utility •Channel Archiver (SNS) •Channel Watcher (SLAC) •EDM: Extensible Display Manager (ORNL) •JoiMint: Java Operator Interface and Management INtegration Toolkit (DESY) •Knobs: Knob Manager und KnobConfig, eine Schnittstelle zu SunDials •MEDM: Motif Editor und Display Manager •StripTool: Strip-chart Plotting Tool •Command line tools (caget, caput, …)•and many more …

Page 23: EPICS Training @ PSI

EPICS Training @ PSI

Example: ALH

Page 24: EPICS Training @ PSI

EPICS Training @ PSI

Alarms and Colours

NO_ALARM Green Everything ok

MINOR Yellow Warning

MAJOR RedError

(no Controls Problem)

INVALID White Device not reachable

Not connectedWhite block or Pink

Record not known

Page 25: EPICS Training @ PSI

EPICS Training @ PSI

Example: ALH

Tree structure of Records

Guidance

Panel with moreInformation

Usefull for users who know the environment(for example operators in the main control room)

Page 26: EPICS Training @ PSI

EPICS Training @ PSI

Some CA Clients

(from the EPICS Website - incomplete)•ALH: Alarm Handler •BURT: Backup and Restore Tool •CASR: Host-based Save/Restore •CAU: Channel Access Utility •Channel Archiver (SNS) •Channel Watcher (SLAC) •EDM: Extensible Display Manager (ORNL) •JoiMint: Java Operator Interface and Management INtegration Toolkit (DESY) •Knobs: Knob Manager und KnobConfig, eine Schnittstelle zu SunDials •MEDM: Motif Editor und Display Manager •StripTool: Strip-chart Plotting Tool •Command line tools (caget, caput, …)•and many more …

Page 27: EPICS Training @ PSI

EPICS Training @ PSI

Examples: StripTool

time

channelvalues

Page 28: EPICS Training @ PSI

EPICS Training @ PSI

Some CA Clients

(from the EPICS Website - incomplete)•ALH: Alarm Handler •BURT: Backup and Restore Tool •CASR: Host-based Save/Restore •CAU: Channel Access Utility •Channel Archiver (SNS) •Channel Watcher (SLAC) •EDM: Extensible Display Manager (ORNL) •JoiMint: Java Operator Interface and Management INtegration Toolkit (DESY) •Knobs: Knob Manager und KnobConfig, eine Schnittstelle zu SunDials •MEDM: Motif Editor und Display Manager •StripTool: Strip-chart Plotting Tool •Command line tools (caget, caput, …)•and many more …

caQtDM: Display Manager

Page 29: EPICS Training @ PSI

EPICS Training @ PSI

Examples for caQtDM

Page 30: EPICS Training @ PSI

EPICS Training @ PSI

Contents

• What is EPICS• The Parts of EPICS• What are Records• An Example for a Record• How to Solve Problems with EPICS

Page 31: EPICS Training @ PSI

EPICS Training @ PSI

Close Look at a Measured Value

295,5with a unit mA

with a time stamp 17.2.2005 14:21:16

with a severity (alarm state) NO_ALARM

with technical limits 0 to 400

with graphical limits 0 to 370

A measured value is an object with multiple related informationthat have different data types

with a description „Beam current in SR“

Value with a data type

Page 32: EPICS Training @ PSI

EPICS Training @ PSI

What are Records?

A Record is an object with– a unique name– properties (fields) that contain information (data)

different data types can appear in different fields– the ability to perform actions on that data

XYZ1234

Employee : James Bond

Badge Number: 007

Address : Whitehall, London

Salary : £70070.07

unique name

fields data

Page 33: EPICS Training @ PSI

EPICS Training @ PSI

Make a Record from a Measured Value

Configured by developer

VAL SEVR TIME

295,5

with a unit mA

17.2.2005 14:21:16

NO_ALARM

with technical limits 0 to 400

with graphical limits 0 to 370

with a description „Beam current in SR“

A value with a data type

with a unique name ARIDI-PCT:CURRENT

ai

record (ai, "ARIDI-PCT:CURRENT") {

with a time stamp

Read back from hardware/driver

with a severity (alarm status)

field (EGU, "mA")field (EGUF, "400")field (EGUL, "0")field (HOPR, "370")field (LOPR, "0")field (DESC, "Beam current in SR")field (DTYP, "HY8401")field (INP, "#C3 S0 @")

}

Page 34: EPICS Training @ PSI

EPICS Training @ PSI

A Process Variable Name

• A PV name is comprised of two parts– The record name, and– the name of a field belonging to that record

• For example…

A record name

ARIDI-PCT:CURRENT

A field name

EGU.

A dot to join them

A Process variable name

• Note that if no field name is given, Channel Access will default to using the .VAL field “ARIDI-PCT:CURRENT” is interpreted as “ARIDI-PCT:CURRENT.VAL”

that means:

most record fields

can be accessed

individually

Page 35: EPICS Training @ PSI

EPICS Training @ PSI

View of a Record field(DRVH,"100")

field(DRVL,"0") field(HOPR,"80") field(LOPR,"10") field(HIHI,"0.0e+00") field(LOLO,"0.0e+00") field(HIGH,"0.0e+00") field(LOW,"0.0e+00") field(HHSV,"NO_ALARM") field(LLSV,"NO_ALARM") field(HSV,"NO_ALARM") field(LSV,"NO_ALARM") field(HYST,"0.0e+00") field(ADEL,"0.0e+00") field(MDEL,"0.0e+00") field(SIOL,"") field(SIML,"") field(SIMS,"NO_ALARM") field(IVOA,"Continue normally") field(IVOV,"0.0e+00")}

record(ao,"DemandTemp") {

field(DESC,"Temperature") field(ASG,"") field(SCAN,"Passive") field(PINI,"NO") field(PHAS,"0") field(EVNT,"0") field(DTYP,"VMIC 4100") field(DISV,"1") field(SDIS,"") field(DISS,"NO_ALARM") field(PRIO,"LOW") field(FLNK,"") field(OUT,"#C0 S0") field(OROC,"0.0e+00") field(DOL,"") field(OMSL,"supervisory") field(OIF,"Full") field(PREC,"1") field(LINR,"NO CONVERSION") field(EGUF,"100") field(EGUL,"0") field(EGU,"Celcius")

All record fields

have default values

(in case they are not

specified by the

developer)

Page 36: EPICS Training @ PSI

EPICS Training @ PSI

What do Records do?

•Analog in•Analog out•Binary in•Binary out•Calculation•Calculation out•Compression•Data fanout•Event•Fanout•Histogram•Motor•Multi bit binary input•Multi bit binary output •PID control•Pulse counter•Pulse delay•Scan•Select•Sequence•String in•String out•Subarray•Subroutine•Waveform

• Depends on

1. Record Type

2. Field values• Records are active, they do things

– Get data from other records or from hardware

– Perform calculations– Check values are in range and raise

alarms– Put data to other records or to

hardware– Activate or disable other records– Wait for hardware signals (interrupts)

• record do nothing until they are processed

incompletelist!

Page 37: EPICS Training @ PSI

EPICS Training @ PSI

Record Processing

Record processing can be periodic or event driven:

•Periodic: Standard scan rates are…– 10, 5, 2, 1, 0.5, 0.2 and 0.1 seconds– Custom scan rates can be configured up

to speeds allowed by operating system and hardware

– No precise timing!

•Event driven: Events include– Hardware interrupts– Request from another record via links– EPICS Events– Channel Access Puts

Record Processing means:

Trigger Record to do what it

is configured to do.

Page 38: EPICS Training @ PSI

• Explains records from the EPICS base release• Explains database concepts, record types, and record fields

• New Version as Wiki:http://www.aps.anl.gov/epics/wiki/index.php/RRM_3-14

• Old Version (R3.13): pdf: http://www.aps.anl.gov/epics/EpicsDocumentation/AppDevManuals/RecordRef/Recordref.pdf

• More Records exist.For example Motor Record (part of synApps package)

EPICS Training @ PSI

The Record Reference Manual

Test:

What does the

field HSV

of an ai Record?

Page 39: EPICS Training @ PSI

EPICS Training @ PSI

Contents

• What is EPICS• The Parts of EPICS• What are Records• An Example for a Record• How to Solve Problems with EPICS

Page 40: EPICS Training @ PSI

EPICS Training @ PSI

Example Record

Temperature Sensor

IOCDatabase

Analog to Digital

Converter

0 – 100°C

0 – 10V

8 bit ADC

0 – 10V

0 – 255 bits

Process

Normal Operation

5 - 50°C

record (ai, “MTRT1-TEMP:READ”) {

field (EGU, “deg C”)field (EGUL, “0”)field (EGUF, “100”) field (HSV, “MAJOR”)field (HIGH, “51”)

field (SCAN, “.1 second”) field (DTYP, “Hy8401”) field (INP, “#C3 S0 @”) }

Page 41: EPICS Training @ PSI

EPICS Training @ PSI

Value (34 °C)

CA Client: caQtDM

Driver

Device Support

Record Support record (ai, “MTRT1-TEMP:READ”){ … field (SCAN, “.1 second”) field (DTYP, “Hy8401”) field (INP, “#C3 S0 @”) field (VAL, “34”)… }

every 0.1 seconds the recordasks the driver for a value

and the driver reports back

caQtDM sets a CA monitor

every time the value changesrecord triggers callback

IOC

Example Record

Page 42: EPICS Training @ PSI

EPICS Training @ PSI

• Switch on VME (on every VME a Record is created, which is connected to the first potentiometer)

• Type into a terminal:

caget MTRT1-TEMP:READ

(change the 1 to the number of your training station)

• Move the potentiometer• Ask for another values

Get a Values from a Record

Page 43: EPICS Training @ PSI

EPICS Training @ PSI

CA Commands

• Read a PV named <NAME>

caget NAME• Get information about that Record

cainfo NAME• Start a monitor

camon NAME

(Cancel with [Ctrl] + [c])• Without argument all commands show some

help

caget MTRT1-TEMP:READ

cainfo MTRT1-TEMP:READ

camon MTRT1-TEMP:READ

caget

Page 44: EPICS Training @ PSI

EPICS Training @ PSI

Create a Graphical User Interface (GUI)

1. To start the Qt Designer:(editor to create new GUI)

caqtdm_designer &

2. To start an existing GUI (configuration file already exist):

caqtdm <name>.ui &

Page 45: EPICS Training @ PSI

EPICS Training @ PSI

Create a caQtDM window (1/4)

select “Main Window”

create

Page 46: EPICS Training @ PSI

EPICS Training @ PSI

Create a caQtDM window (2/4)

Page 47: EPICS Training @ PSI

EPICS Training @ PSI

Create a caQtDM window (3/4)

MTRT1-TEMP:READ

Page 48: EPICS Training @ PSI

EPICS Training @ PSI

Create a caQtDM window(4/4)

Temperature.ui

Page 49: EPICS Training @ PSI

EPICS Training @ PSI

Create a Graphical User Interface (GUI)

1. To start the Qt Designer:(editor to create new GUI)

caqtdm_designer &

2. To start an existing GUI (configuration file already exist):

caqtdm <name>.ui &

Page 50: EPICS Training @ PSI

EPICS Training @ PSI

Running a caQtDM Window

Page 51: EPICS Training @ PSI

EPICS Training @ PSI

Files for the Temperature Example

• Change into local directory:cd G/TRAINING/T1

• Open the files in an editor: G_TRAINING_T1_TEMPERATUR.template

MTEST-VME-T1_example.subs

For example use nedit &

(click on file -> open)

Page 52: EPICS Training @ PSI

EPICS Training @ PSI

Inside the Files

substitution file

template file

Page 53: EPICS Training @ PSI

Why Substitution and Template Files?

EPICS Training @ PSI

• What to do if you have more than one instance of a device?– Multiply the record and change the name

works ok– If you have 20 devices the file gets lengthy– If the device not only needs one record but

more(BPM with at least x, y, and intensity)the file gets even more lengthy and confusing [spell maintenance nightmare]

• Solution provided by EPICS:substitution (with macro definition) and template files

Page 54: EPICS Training @ PSI

EPICS Training @ PSI

Inside the Files

DEVICE = MTRT1$(DEVICE)-TEMP:READ

MTRT1-TEMP:READ

Page 55: EPICS Training @ PSI

EPICS Training @ PSI

Exercise: a Second Record

• Imagine we have a second temperature sensor – we need a second record

Edit the substitution file (MTEST-VME-T1_example.subs)

Page 56: EPICS Training @ PSI

How to get the Record to the VME

EPICS Training @ PSI

Linux PC Central Server Trainings VME

install filesget files

during reboot

New records can only be created during restart of an IOC (for VME this means reboot)

Page 57: EPICS Training @ PSI

EPICS Training @ PSI

Installing an EPICS Database

• Everything written correctly?• Install to the boot directory of the IOC

swit –V -ioc IOC-NAME

(enter command in the local directory which contains the files to be installed)

• Reboot IOC:Log into the IOC using

rmc IOC-NAME

and type in (soft reboot)

reboot MTEST-VME-T1> reboot

rmc MTEST-VME-T1

swit -V -ioc MTEST-VME-T1

Page 58: EPICS Training @ PSI

EPICS Training @ PSI

What Happens at Booting

• Boot Info (memory) VME-IOC: where to find the startup.script

• Load startup.script• In startup.script: list of .subs files• Load .subs files• In .subs files: List of .template files• Load .template files with substitutions• Create all loaded records

Page 59: EPICS Training @ PSI

EPICS Training @ PSI

Commands on the VME Computer

• Get a list of all installed records (on this IOC)

dbl• Get the number of installed records

dbnr• View interesting fields of a record

dbpr "MTRT1-TEMP:READ",1• To get a list of VxWorks commands

help

Page 60: EPICS Training @ PSI

EPICS Training @ PSI

SLS Naming Convention

Records need unique names1. X=Beamline, A=Machine, M=Test (1 character)2. Project abbreviation (4 characters), e.g. 06SA, TEST,

RI=Ring, DI=DIAGNOSE3. Optional: Device, Group, Component, e.g. OP, ID4. Device, e.g. MO5. Optional: Function (max. 11 characters),

z.B. TRY1-SET

[1][2] – [3] – [4] : [5]Length of [3]+length of [4] ≤ 12 charactersolder EPICS: Names have 27 characters at maximum

Page 61: EPICS Training @ PSI

EPICS Training @ PSI

Name for the Temperature Sensors

M = Test

TR = Training

T1, T2, T3, T4 = Training IOCs

TEMP = Temperature

READ = Record for reading

For a second sensor:

TEMP1 for the first, TEMP2 for the second:

MTRT1-TEMP1:READ und MTRT1-TEMP2:READ

Page 62: EPICS Training @ PSI

EPICS Training @ PSI

Exercise: caQtDM Application

• Create an caQtDM GUI, which shows:– Your own Records– All Records of the course– The alarm states of all records

• More to do: Create a second GUI, which displays all records with names starting like MTEST-VME-T running on your IOC.

Page 63: EPICS Training @ PSI

EPICS Training @ PSI

IOC Status

On every IOC there are some Status Records created automatically:

caqtdm -macro IOC=MTEST-VME-T1 /work/sls/config/qt/G_IOCMON_ioc_status.ui

Page 64: EPICS Training @ PSI

EPICS Training @ PSI

Contents

• What is EPICS• The Parts of EPICS• What are Records• An Example for a Record• How to Solve Problems with EPICS

Page 65: EPICS Training @ PSI

EPICS Training @ PSI

Problem:

In the LINAC we have a water chiller that must be turned ON whenever the average temperature of two temperature sensors rises above a set point. The set point is nominally 10 degrees centigrade.

Solve a Problem in EPICS

Binary out

MTRT1-LI-COOL:SW

CalculationMTRT1-LI-COOL:CALC

CALC: ( (A+B)/2 ) > C

C: 10

SCAN: 10 second

Analog In

MTTR1-LI-COOL:TEMP1

EGU: deg C

VALINP

EGU: deg C

VALINP

INPB

INPA

VAL DOL OUT

T2Sensor

SensorT1

IOC

DatabaseADC

ADC

BinaryI/O

ChillerAnalog In

MTRT1-LI-COOL:TEMP2

Page 66: EPICS Training @ PSI

EPICS Training @ PSI

The subs File

• Name of the file: MTEST-VME-T1_example.subs

# means this line is a comment

Page 67: EPICS Training @ PSI

Different Styles of subs files

EPICS Training @ PSI

few instances many instances

Files are written for programmers not for computers!

Page 68: EPICS Training @ PSI

EPICS Training @ PSI

The Template File

• Predefined records in the file G_TRAINING_T1_COOLER.template

Page 69: EPICS Training @ PSI

EPICS Training @ PSI

Useful Scripts

• Is everything spelled correctly?

externalLinks subs-File

• What was the name of this record?

findrecord Name-Part

• When was this IOC booted last time?

bootinfo IOC-Name

externalLinks MTEST-VME-T1_example.subs

findrecord MTRT1-LI

bootinfo MTEST-VME-T1

Page 70: EPICS Training @ PSI

Steps of Development

1. Change your files

2. Save your files

3. Check syntax with externalLinks

4. Install IOC files

5. Reboot IOC(in rmc window: reboot)

6. Test

EPICS Training @ PSI

swit -V -ioc MTEST-VME-T1

externalLinks MTEST-VME-T1_example.subs

Page 71: EPICS Training @ PSI

EPICS Training @ PSI

10 Really Neat Things About EPICS

1. It is free

2. It is Open Source

3. There are lots of users

4. All a client needs to know to access data is a PV name

5. You can pick the best tools out there …

6. … or build your own

7. The boring stuff is already done

8. There is a lot of expertise available close by

9. A good contribution becomes internationally known

10. It does not matter, if you need 10 or 10 million PVs

11. It is fun (don’t tell the management)

Page 72: EPICS Training @ PSI

EPICS Training @ PSI

EPICS Web Page

The central site for EPICS information

- Documentation

- CA Clients

- Device support (driver)

- Tech-talk (mailing list and archive)

http://www.aps.anl.gov/epics