1 1999/Ph 514: What is an EPICS Database? EPICS What is an EPICS Database? Andrew Johnson APS.

Slides:



Advertisements
Similar presentations
Chapter 3 Basic Input/Output
Advertisements

1 1999/Ph 514: Channel Access Concepts EPICS Channel Access Concepts Bob Dalesio LANL.
EPICS Tutorial - IOC Database Raja Ramanna Centre For Advanced Technology Indore India January Presented by: Marty Kraimer Based on Presentations.
CS-334: Computer Architecture
EPICS Database Principles Andrew Johnson Computer Scientist, AES Controls.
EPICS Class – Process Database Most slides here are taken from: – “EPICS Database Principles” by Andrew Johnson Some slides modified by me After lecture,
6-1 I/O Methods I/O – Transfer of data between memory of the system and the I/O device Most devices operate asynchronously from the CPU Most methods involve.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Inter Process Communication:  It is an essential aspect of process management. By allowing processes to communicate with each other: 1.We can synchronize.
V4 – Executive Summary 1.Provide online add/delete of I/O to support continuous operation. 2.Provide redundant control of remote I/O to support improved.
INPUT/OUTPUT ORGANIZATION INTERRUPTS CS147 Summer 2001 Professor: Sin-Min Lee Presented by: Jing Chen.
Fundamentals of Python: From First Programs Through Data Structures
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
Input/Output. Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower.
General System Architecture and I/O.  I/O devices and the CPU can execute concurrently.  Each device controller is in charge of a particular device.
Chapter 10: Input / Output Devices Dr Mohamed Menacer Taibah University
Managed by UT-Battelle for the Department of Energy EPICS Database … in 1 hour?! Kay Kasemir, SNS/ORNL Many slides from Andrew Johnson, APS/ANL, Jan
Imperial College Tracker Slow Control & Monitoring.
Segmentation & O/S Input/Output Chapter 4 & 5 Tuesday, April 3, 2007.
A U.S. Department of Energy Office of Science Laboratory Operated by The University of Chicago Argonne National Laboratory Office of Science U.S. Department.
CHAPTER 2: COMPUTER-SYSTEM STRUCTURES Computer system operation Computer system operation I/O structure I/O structure Storage structure Storage structure.
1 Experimental Physics and Industrial Control System (EPICS) Database Bob Dalesio, May 31,2010.
Experimental Physics and Industrial Control System (EPICS) Database Bob Dalesio, June 27,2001.
EPICS devSNMP Extensions Euan Troup, CSIRO Australia Telescope National Facility ASKAP Project Paul Wild Observatory.
1 1999/Ph 514: Record Support EPICS Record Support Marty Kraimer APS.
1 1999/Ph 514: EPICS Database II EPICS EPICS Database II Ned D. Arnold APS.
3.14 Work List IOC Core Channel Access. Changes to IOC Core Online add/delete of record instances Tool to support online add/delete OS independent layer.
DEBUGGING EPICS APPLICATIONS Bob Dalesio and Rozelle Wright February 10, 1997.
Writing a Channel Access Client in EPICS Bob Dalesio, April 5, 2000.
Writing a Channel Access Client in EPICS Bob Dalesio, April 5, 2000.
Fast Fault Finder A Machine Protection Component.
EPICS Release 3.15 Bob Dalesio May 19, Features for 3.15 Support for large arrays - done for rsrv in 3.14 Channel access priorities - planned to.
1 EPICS January 2009What is an EPICS Database What is an EPICS Database? Andrew Johnson APS (modified by Philip Taylor & Andy Foster )
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 2 Computer-System Structures Slide 1 Chapter 2 Computer-System Structures.
1 1999/Ph 514: Flow of Control EPICS Flow of Control Marty Kraimer APS.
Control System Overview J. Frederick Bartlett Fermilab June 1,1999.
Silberschatz, Galvin and Gagne  Applied Operating System Concepts Chapter 2: Computer-System Structures Computer System Architecture and Operation.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Managed by UT-Battelle for the Department of Energy EPICS Database Kay Kasemir, SNS/ORNL Many slides from Andrew Johnson, APS/ANL Sept
Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower than CPU.
EPICS Tutorial IOC Database EPICS Meeting INFN October Presented by: Marty Kraimer Based on Presentations by Andrew Johnson and Bob Dalesio.
1 Channel Access Concepts – IHEP EPICS Training – K.F – Aug EPICS Channel Access Concepts Kazuro Furukawa, KEK (Bob Dalesio, LANL)
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 2: The Linux System Part 2.
1 EPICS Flow of Control: EPICS Workshop at IHEP, Beijing, August 2001 EPICS Flow of Control Marty Kraimer APS.
EPICS Records J. Frederick Bartlett Fermilab June 1,1999.
Control System Overview J. Frederick Bartlett Fermilab June 1,1999.
An Introduction to Epics/Tango Steve Hunt Alceli EPICS Meeting 2008 INFN Legnaro 15 Oct 17:15.
1 1999/Ph 514: Lab #2 : IOC Database EPICS Lab #2 IOC Database.
Monitoring Dynamic IOC Installations Using the alive Record Dohn Arms Beamline Controls & Data Acquisition Group Advanced Photon Source.
EPICS Database Principles Andrew Johnson APS Engineering Support Division October 17th, 2006 SNS EPICS Training.
JavaIOC Overview and Update
EPICS Class – Process Database
Chapter 2: Computer-System Structures
Chapter 2: The Linux System Part 2
Module 2: Computer-System Structures
Marty Kraimer Advanced Photon Source Argonne National Laboratory
EPICS Database … in 1 hour?!
Chapter 8 I/O.
Channel Access Concepts
Chapter 2: Computer-System Structures
Chapter 2: Computer-System Structures
Module 2: Computer-System Structures
Module 2: Computer-System Structures
Chapter 13: I/O Systems.
Channel Access Concepts
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

1 1999/Ph 514: What is an EPICS Database? EPICS What is an EPICS Database? Andrew Johnson APS

2 1999/Ph 514: What is an EPICS Database? EPICS Outline u Records u Fields and field types u Record Scanning u Input and Output record types u Hardware support u Links u Chaining Records together u Protection mechanisms u Alarms, deadbands, simulation and security

3 1999/Ph 514: What is an EPICS Database? EPICS Database = Records + Fields + Links u A control system using EPICS will contain one or more IOCs u Each IOC loads one or more Databases telling it what to do u A Database is a collection of Records of various types u A Record is an object with: u A unique name u A behaviour defined by its record type (class) u Controllable properties (fields) u Optional associated hardware I/O (device support) u Links to other records

4 1999/Ph 514: What is an EPICS Database? EPICS Record Activity u Records are active — they can do things: u Get data from other records or from hardware u Perform calculations u Check values are in range & raise alarms u Put data to other records or to hardware u Activate or disable other records u Wait for hardware signals (interrupts) u What a record does depends upon its record type and the settings of its fields u No action occurs unless a record is processed

5 1999/Ph 514: What is an EPICS Database? EPICS How is a Record implemented? u A ‘C’ structure with both data storage and pointers to record type information u A record definition within a database provides u Record name u The record’s type u Values for each design field u A record type provides u Definitions of all the fields u Code which implements the record behaviour u New record types can be added to an application as needed

6 1999/Ph 514: What is an EPICS Database? EPICS One view of a Record The small CapFast symbol for an Analogue Output record

7 1999/Ph 514: What is an EPICS Database? EPICS Another view

8 1999/Ph 514: What is an EPICS Database? EPICS The IOC’s view 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") 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") } The full.db file entry for an Analogue Output Record This shows only the design fields, there are other fields which are used at run-time

9 1999/Ph 514: What is an EPICS Database? EPICS Fields are for... u Defining u What causes a record to process u Where to get/put data from/to u How to turn raw I/O data into a numeric engineering value u Limits indicating when to report an alarm u When to notify value changes to a client monitoring the record u A Processing algorithm u Anything else which needs to be set for each record of a given type u Holding run-time data u Input or output values u Alarm status, severity and acknowledgements u Processing timestamp u Other data for internal use

/Ph 514: What is an EPICS Database? EPICS Field types u Fields can contain u Integers u char, short or long u signed or unsigned u Floating-point numbers u float or double u Strings u max length 40 characters or less u Menu choices u select one from several strings u stored as a short integer u Links u to other records in this or other IOCs u to hardware signals (device support) u provide a means of getting or putting a value u Other private data u not directly accessible

/Ph 514: What is an EPICS Database? EPICS All Records have these fields Design fields NAME 28 Character unique name DESC 28 Character description ASG Access security group SCAN Scan mechanism PHAS Scan order (phase) PINI Process at startup? PRIO Scheduling priority SDIS Scan disable input link DISV Scan disable value DISS Disabled severity FLNK Forward link Run-time fields PROC Force processing PACT Process active STAT Alarm status SEVR Alarm severity TPRO Trace processing UDF Set if record value undefined TIME Time when last processed

/Ph 514: What is an EPICS Database? EPICS Record Scanning  SCAN field is a menu choice from u Periodic — 0.1 seconds.. 10 seconds u I/O Interrupt (if device supports this)  Soft event — EVNT field u Passive (default)  The number in the PHAS field allows processing order to be set within a scan  Records with PHAS=0 are processed first  Then those with PHAS=1, PHAS=2 etc.  Records with PINI=YES are processed once at startup  PRIO field selects Low/Medium/High priority for Soft event and I/O Interrupts  A record is also processed whenever any value is written to its PROC field

/Ph 514: What is an EPICS Database? EPICS Input records often have these fields INP Input link DTYP Device type RVAL Raw data value VAL Engineering value LOPR Low operator range HOPR High operator range u Analogue I/O records have these fields: LINR Unit conversion control  No conversion, Linear, breakpoint tables… EGUL Low engineering value EGUF High engineering value EGU Engineering unit string

/Ph 514: What is an EPICS Database? EPICS Periodic Input u Analogue Input “Temperature” u Reads from the Xycom XY566 ADC Card 0 Signal 0 u Gets a new value every 0.1 seconds u Data is converted from ADC range to Celsius

/Ph 514: What is an EPICS Database? EPICS Interrupt Input u Binary Input “VentValve” u Reads from Allen-Bradley TTL I/O Link 0, Adaptor 0, Card 3, Signal 5 u Processed whenever value changes u 0 = “Closed”, 1 = “Open” u Major alarm when valve open

/Ph 514: What is an EPICS Database? EPICS Output records often have these fields OUT Output link DTYP Device type VAL Engineering value RVAL Raw output value DOL Input link to fetch output value OMSL Output mode select  Supervisory, Closed Loop LOPR Low operator range HOPR High operator range u Analogue outputs also have these fields: OROC Output rate of change OIF Incremental or Full output OVAL Output value DRVH Drive high limit DRVL Drive low limit IVOA Invalid output action IVOV Invalid output value RBV Read-back value

/Ph 514: What is an EPICS Database? EPICS Passive Output u Binary Output “Solenoid” u Controls Xycom XY220 Digital output Card 2 Signal 12 u Record is only processed by  Channel Access ‘put’ to a PP field (e.g..VAL )  Another record writes to a PP field (e.g..VAL ) u Forward Link from another record  Another record reads this with.PP

/Ph 514: What is an EPICS Database? EPICS Links A link is a type of field, and is one of u Input link u Fetches data u Output link u Writes data u Forward link u Points to the record to be processed once this record finishes processing

/Ph 514: What is an EPICS Database? EPICS Input and Output links may be... u Constant numeric value, eg: e-19 u Hardware link A hardware I/O signal selector, the format of which depends on the device support layer u Process Variable link — the name of a record, which at run-time is resolved into u Database link Named record is in this IOC u Channel Access link Named record not found in this IOC

/Ph 514: What is an EPICS Database? EPICS Hardware links VME_IO#Cn Card, Signal CAMAC_IO#Bn Cn Nn An Branch, Crate, Node, Address, Function AB_IO #Ln An Cn or #Ln Pn Cn Sn Link, Adaptor, Card, Signal, Flag GPIB_IO#Ln Link, Address BITBUS_IO#Ln Nn Pn Link, Node, Port, Signal BBGPIB_IO#Ln Bn Link, Bitbus Address, GPIB Address VXI_IO#Vn Cn or #Vn Frame, Slot, Signal

/Ph 514: What is an EPICS Database? EPICS Database links These comprise: u The name of a record in this IOC myDb:myRecord u An optional field name.VAL (default) u Process Passive flag.NPP (default).PP u Maximize Severity flag.NMS (default).MS For example: M1:current.RBV.NPP.MS  NB: Get with.PP from record with asynchronous device support will not return the new value

/Ph 514: What is an EPICS Database? EPICS Channel Access links u Specified like a database link u Name is not a record found in this IOC u Use Channel Access protocol to communicate with remote IOC  May include a field name (default.VAL ) .PP Link flags are ignored:  Input links always.NPP  Output links follow PP attribute of destination field  This behavior identical to all other CA clients .MS Link flags apply to Input links:  Input links honour the.NMS or.MS flags  Output links always.NMS  Additional flags.CA Forces a “local” link to use CA.CP Process record when value changes.CPP Like.CP but only if Scan Passive

/Ph 514: What is an EPICS Database? EPICS Link flag summary Pages 16 thru 23 of the IOC Application Developer’s Guide cover this topic.

/Ph 514: What is an EPICS Database? EPICS Device Support u Records do not access hardware directly u The Device Support layer performs I/O operations on request u A particular device support provides I/O for a single record type  The DTYP field determines which device support to use  The device support selected determines the format of the link ( INP or OUT field) containing device address information u Adding new device support does not require change to the record software u Device support may call other software to do work for it (Driver Support)

/Ph 514: What is an EPICS Database? EPICS Synchronous vs Asynchronous I/O u EPICS rules do not allow device support to busy-wait (poll for results of slow I/O) u Register-based VME cards usually give an immediate response: synchronous u When called, synchronous device support performs all I/O before returning u Serial & I/O-bus devices take a long time (>10ms) to return data: asynchronous  Asynchronous device support starts I/O when record calls it, flags it as incomplete by setting PACT true before returning u Once results are available (CPU interrupt) device support calls the record’s process routine which finishes the operation

/Ph 514: What is an EPICS Database? EPICS Soft Device Support u Input and Output records are designed to perform hardware I/O via device support u They can also access other records via DB or CA links, using soft device support u 2 kinds of support are provided: u Soft Channel  Get/Put VAL through link, no conversion u Raw Soft Channel u Inputs  Get RVAL via input link  Convert RVAL to VAL (device specific) u Outputs  Convert VAL to RVAL (device specific)  Put RVAL to output link

/Ph 514: What is an EPICS Database? EPICS Forward links u Usually a database link refering to a record in same IOC  Channel Access links possible, must name the PROC field of the remote record  No flags (.PP,.NMS etc) u Destination record must have SCAN = Passive for it to be processed u Does not pass a value, just causes subsequent processing

/Ph 514: What is an EPICS Database? EPICS Processing chains

/Ph 514: What is an EPICS Database? EPICS Which record is never processed?

/Ph 514: What is an EPICS Database? EPICS Which record is processed twice?

/Ph 514: What is an EPICS Database? EPICS The PACT field  Every record has a boolean run-time field called PACT (Process Active)  PACT breaks loops of linked records u It is set to ‘true’ early in the act of processing the record  PACT is true whenever a link in that record is used to get/put a value  PACT is set to false after record I/O and forward link processing are finished  A.PP link can never make a record process if it has PACT true u Input links take the current value u Output links just put their value

/Ph 514: What is an EPICS Database? EPICS What happens here?

/Ph 514: What is an EPICS Database? EPICS Preventing records from processing u It is useful to be able to stop an individual record from processing on some condition  Before record-specific processing is called, a value is read through the SDIS input link into DISA  If DISA=DISV, the record will not be processed  A disabled record is alarmed by giving the desired severity in the DISS field  The FLNK of a disabled record is not triggered

/Ph 514: What is an EPICS Database? EPICS How are records given CPU time? Several vxWorks tasks are used: u callback (3 priorities) — I/O Interrupt u scanEvent — Soft Event u scanPeriod — Periodic u A separate task is used for each scan period u Faster scan rates are given higher vxWorks task priority u Channel Access tasks use lower priority than record processing u If a CPU spends all the time doing I/O and processing, you will be unable to control or monitor the IOC via the network

/Ph 514: What is an EPICS Database? EPICS What could go wrong here?

/Ph 514: What is an EPICS Database? EPICS Lock-sets u Prevent a record from being processed simultaneously from two scan tasks u A lock-set is a group of records interconnected by: u Output Database links u Forward links  Input links which are.PP or.MS u Arrays u Lock-sets are determined automatically by the IOC at start-up You can split a lock set with  Channel Access links, using.CA flag  Database links which are.NPP.NMS

/Ph 514: What is an EPICS Database? EPICS Alarms u Every record has the fields SEVR Alarm Severity  NONE, MINOR, MAJOR, INVALID STAT Alarm Status (reason)  READ, WRITE, UDF, HIGH, LOW, STATE, COS, CALC, DISABLE, etc.  Most numeric records check VAL against HIHI, HIGH, LOW and LOLO fields after the value has been determined  The HYST field prevents alarm chattering  A separate severity can be set for each numeric limit ( HHSV, HSV, LSV, LLSV ) u Discrete (binary) records can raise alarms on entering a particular state, or on a change of state (COS)

/Ph 514: What is an EPICS Database? EPICS Change notification: Monitor deadbands Channel Access notifies clients which are monitoring a numeric record when  VAL changes by more than the value in field: MDEL Value monitors ADEL Archive monitors u Record’s Alarm Status changes HYST Alarm hysteresis  Analogue Input record provides smoothing filter to reduce input noise ( SMOO )

/Ph 514: What is an EPICS Database? EPICS Breakpoint Tables u Analogue Input and Output records can do non- linear conversions from/to the hardware data u Breakpoint tables interpolate from given table u To use, set the record’s LINR field to the name of the breakpoint table you want to use u Example breakpoint table (in your.dbd file) breaktable(attenuator1_1) { }

/Ph 514: What is an EPICS Database? EPICS Simulation u Input and output record types often allow simulation of hardware interfaces SIML Simulation mode link SIMM Simulation mode value SIOL Simulation input link SIMS Simulation alarm severity  Before using its device support, a record reads SIMM through the SIML link  If SIMM=YES, device support is ignored; record I/O uses the SIOL link instead  An alarm severity can be set whenever simulating, given by SIMS field

/Ph 514: What is an EPICS Database? EPICS Access Security u A networked control system must have the ability to enforce security rules u Who can do what from where, and when? u In EPICS, security is enforced by the CA server (typically the IOC).  A record is placed in the Access Security Group named in its ASG field u DEFAULT is used if no group name is given u Rules for each group determine whether a CA client can read or write to records in the group, based on u Client user ID u Client IP address u Access Security Level of the field addressed u Values read from the database

/Ph 514: What is an EPICS Database? EPICS Access Security Configuration File u Security rules are loaded from an Access Security Configuration File, for example: UAG(users) {user1, user2} HAG(hosts) {host1, host2} ASG(DEFAULT) { RULE(1, READ) RULE(1, WRITE) { UAG(users) HAG(hosts) } u If no security file is loaded, Security will be turned off and nothing refused u For details and syntax, see Chapter 5 of the IOC Application Developers Guide