1 EPICS January 2009What is an EPICS Database What is an EPICS Database? Andrew Johnson APS (modified by Philip Taylor & Andy Foster 2004-2009)

Slides:



Advertisements
Similar presentations
Computer Architecture
Advertisements

1 1999/Ph 514: Channel Access Concepts EPICS Channel Access Concepts Bob Dalesio LANL.
EPICS Base R and beyond Andrew Johnson Computer Scientist, AES Controls Group.
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,
Process Description and Control Module 1.0. Major Requirements of an Operating System Interleave the execution of several processes to maximize processor.
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.
What are Exception and Interrupts? MIPS terminology Exception: any unexpected change in the internal control flow – Invoking an operating system service.
JavaIOC Marty Kraimer EPICS Collaboration Meeting ICALEPCS October
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.
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.
Copyright © 2007, Oracle. All rights reserved. Managing Concurrent Requests.
2: Computer-System Structures
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.
Advanced Database Topics Bob Dalesio Outline Record processing Database Record Types Field Access Conclusions.
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.
Storing and Organizing Data. Why Do I Need to Understand How Data Is Represented? In order to install, program,maintain, and troubleshoot today’s PLCs,
1 Channel Access Concepts – EPICS Training – K.Furukawa – Mar EPICS Channel Access Concepts Kazuro Furukawa, KEK, ( ) (Bob Dalesio, LANL,
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.
Relational Databases. Relational database  data stored in tables  must put data into the correct tables  define relationship between tables  primary.
Interrupt driven I/O. MIPS RISC Exception Mechanism The processor operates in The processor operates in user mode user mode kernel mode kernel mode Access.
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.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Use of a Relational Database at Leda Bob Dalesio
1 1999/Ph 514: Flow of Control EPICS Flow of Control Marty Kraimer APS.
Control System Overview J. Frederick Bartlett Fermilab June 1,1999.
1. LabVIEW and EPICS Workshop EPICS Collaboration Meeting Fall 2011.
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
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower than CPU.
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.
EPICS Tutorial IOC Database EPICS Meeting INFN October Presented by: Marty Kraimer Based on Presentations by Andrew Johnson and Bob Dalesio.
1 1999/Ph 514: What is an EPICS Database? EPICS What is an EPICS Database? Andrew Johnson APS.
Sequencers SQO,SQC,SQL.
1 Channel Access Concepts – IHEP EPICS Training – K.F – Aug EPICS Channel Access Concepts Kazuro Furukawa, KEK (Bob Dalesio, LANL)
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
Andrew Johnson and Eric Norum AES Controls Group, Argonne
Module 2: Computer-System Structures
Process Description and Control
Marty Kraimer Advanced Photon Source Argonne National Laboratory
EPICS Database … in 1 hour?!
Server-Side Plugins Andrew Johnson, Ralph Lange
Channel Access Concepts
Beam Synchronous Acquisition on IOC
Module 2: Computer-System Structures
Module 2: Computer-System Structures
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 EPICS January 2009What is an EPICS Database What is an EPICS Database? Andrew Johnson APS (modified by Philip Taylor & Andy Foster )

2 EPICS January 2009What is an EPICS Database 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 EPICS January 2009What is an EPICS Database 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 EPICS January 2009What is an EPICS Database 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 EPICS January 2009What is an EPICS Database 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 EPICS January 2009What is an EPICS Database One view of a Record: Capfast The small CapFast symbol for an Analogue Output record

7 EPICS January 2009What is an EPICS Database Another view

8 EPICS January 2009What is an EPICS Database Latest View (Visual DCT)

9 EPICS January 2009What is an EPICS Database 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

10 EPICS January 2009What is an EPICS Database 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

11 EPICS January 2009What is an EPICS Database 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 (CA restriction) u Long strings at (add $ to end of string or link fields forces it to be array of char) 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

12 EPICS January 2009What is an EPICS Database All Records have these fields Design fields NAME 61 Character unique name (increased from 29 at ) DESC Description string 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

13 EPICS January 2009What is an EPICS Database Record Scanning  SCAN field is a menu choice from u Passive (default) u Periodic — 0.1 seconds.. 10 seconds u Hardware I/O Interrupt (only if the device supports this)  Soft event — EVNT field  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 PINI now also supports values RUN and PAUSE  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

14 EPICS January 2009What is an EPICS Database 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

15 EPICS January 2009What is an EPICS Database 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

16 EPICS January 2009What is an EPICS Database 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

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

18 EPICS January 2009What is an EPICS Database 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

19 EPICS January 2009What is an EPICS Database Passive Output u Binary Output “Solenoid” u Controls Xycom XY220 Digital output Card 2 Signal 12  Record’s SCAN field is set to Passive – it is processed according to the rules below

20 EPICS January 2009What is an EPICS Database 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

21 EPICS January 2009What is an EPICS Database 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

22 EPICS January 2009What is an EPICS Database 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 attribute.NPP (default on INP and OUT links).PP(default for forward links) u Maximize Severity attribute.NMS (default).MS(Maximize Severity).MSI (Maximize Severity Invalid only).MSS(Maximize Severity and Status) For example: M1:current.RBV.NPP.MS

23 EPICS January 2009What is an EPICS Database Scan Passive Records 1. Forward Link  The default scan method for a record is Passive  A Passive record will not process without some external action  A Passive record can be processed using a Forward Link from another record. See following example.

24 EPICS January 2009What is an EPICS Database Scan Passive Example: Forward Link u In this example, the CALC record is Scan Passive and is triggered by forward links from two AI records  The CALC record will be processed every 2 seconds as well as when an I/O interrupt occurs

25 EPICS January 2009What is an EPICS Database Scan Passive Records 2. Channel Access Put  A field in a record is defined to be either a PP or non- PP field. This attribute is only used by Channel Access ‘puts’.  A Passive record will be processed using a Channel Access ‘put’ to a field with the PP attribute set (e.g..VAL field) u A Channel Access put is not visible on a schematic – data source is outside IOC. EDM Process Variable CAS CAC

26 EPICS January 2009What is an EPICS Database Scan Passive Records 3. Database Link  A Passive record will also be processed when another record reads from or writes to a field with the Process Passive (.PP) attribute set on the database link. u See following example.

27 EPICS January 2009What is an EPICS Database Scan Passive Example: Database Link u Both records are Scan Passive  Record_1 retrieves its output value from Record_2 via its DOL link  The DOL link has the.PP attribute specified, so when Record_1 processes it will trigger processing of Record_2 u When Record_2 has finished processing, the value in its VAL field will be retrieved via DOL; Record_1 will then finish processing

28 EPICS January 2009What is an EPICS Database 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 ) u Input CA links don’t cause destination record processing  Output CA links obey PP attribute of destination field

29 EPICS January 2009What is an EPICS Database Channel Access Database Link Flags  Additional database link flags: .CA Forces a “local” database link to use Channel Access. Applies to both input and output links. .CP Input link only. Use Channel Access. Process this record when destination value changes .CPP Input link only. Use Channel Access. Process this record when destination value changes, but only if this record is Scan Passive

30 EPICS January 2009What is an EPICS Database 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 The default device support is Soft Channel. 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

31 EPICS January 2009What is an EPICS Database Forward Links u Usually a database link referring to a record in same IOC u Destination record must have SCAN = Passive for it to be processed u Does not pass a value, just causes subsequent processing  Channel Access forward links are possible by naming the PROC field of a remote record as the destination of the link

32 EPICS January 2009What is an EPICS Database Processing Chains

33 EPICS January 2009What is an EPICS Database Which record is never processed?

34 EPICS January 2009What is an EPICS Database Which record is processed twice?

35 EPICS January 2009What is an EPICS Database How are records given CPU time? Several 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 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

36 EPICS January 2009What is an EPICS Database 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 u Arrays (because not an atomic operation) 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

37 EPICS January 2009What is an EPICS Database 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)

38 EPICS January 2009What is an EPICS Database 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 )

39 EPICS January 2009What is an EPICS Database 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) { }

40 EPICS January 2009What is an EPICS Database Simulation u Input and output record types often allow simulation of hardware interfaces SIMM Simulation mode (YES/NO) SIML Simulation mode link (sets SIMM) SIOL Simulated data value 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