Difference between revisions of "EPICS Cheat Sheet"

From Beam Line Controls
Jump to navigation Jump to search
(Created page with "== Channel Access (CA) command-lines == * <code>'''caget'''</code> - get the value of one of more PVs * <code>'''caput'''</code> - change the value of a PV * <code>'''camonit...")
 
 
(19 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Channel Access (CA) command-lines ==
== Channel Access command-lines ==


* <code>'''caget'''</code> - get the value of one of more PVs
Channel Access (CA) allows users to interact with Process Variables (PV):
* <code>'''caput'''</code> - change the value of a PV
 
* <code>'''camonitor'''</code> - monitor the value of one or more PVs
:<code>'''caget'''</code> - get the value of one of more PVs
* <code>'''cainfo'''</code> - print info about a PV, including which host is running the IOC
:<code>'''caput'''</code> - change the value of a PV
:<code>'''camonitor'''</code> - monitor the value of one or more PVs
:<code>'''cainfo'''</code> - print info about a PV, including which host is running the IOC


Example:
Example:


  $ caget kmp3:m1.{DESC,RTYP,DTYP,VAL}
$ caget kmp3:m1.VAL
kmp3:m1.VAL            60
  $ caget kmp3:m1.{DESC,RTYP,DTYP}
  kmp3:m1.DESC          theta motor
  kmp3:m1.DESC          theta motor
  kmp3:m1.RTYP          motor
  kmp3:m1.RTYP          motor
  kmp3:m1.DTYP          asynMotor
  kmp3:m1.DTYP          asynMotor
kmp3:m1.VAL           60
 
 
== Noteworthy fields ==
 
A Process Variable (PV) is a the field from a record:  
::<code>PV = record_name + . + field_name''</code>
 
Most common fields:
:<code>'''VAL'''</code> - the default field (used if no field is specified in the vast majority of cases)
:<code>'''SCAN'''</code> - determines when a record processes
:<code>'''NAME'''</code> - the record name (helpful if records are aliased)
:<code>'''DESC'''</code> - record description
:<code>'''RTYP'''</code> - the record type
:<code>'''DTYP'''</code> - the device support type (not meaningful for all record types)
:<code>'''DISP'''</code> - disable puts (ca = channel access & pva = pv access) from outside the IOC (when non-zero); e.g. disable a motor from the motorx_all screen
:<code>'''DISV/DISA/SDIS'''</code> - disable record processing internally
:*Record processing is disabled when <code>'''DISA'''</code> equals <code>'''DISV'''</code> (e.g. uses SDIS field to read in a value/mode, which will disable some control if a certain mode is active)
:*<code>'''DISA'''</code> is set to the value of the PV in the <code>'''SDIS'''</code> field, if it isn't empty
:<code>'''TPRO'''</code> - trace processing: when set to 1 prints out all the records that get processed after the record is processed; used only for troubleshooting
 
<u>Note</u>: some of the fields of a record are actually record attributes (they return the same value for all instances of the record type; see [https://epics.anl.gov/base/R3-16/2-docs/AppDevGuide/DatabaseDefinition.html#x7-2630006.6 https://epics.anl.gov/])




== IOC shell commands ==
== IOC shell commands ==


To connect to (disconnect from) the IOC shell, see [https://wiki-ext.aps.anl.gov/blc/index.php?title=IOC_101#Connecting_to_an_IOC.E2.80.99s_shell here]:
:'''<code>help [command]</code>''' - shows available commands or syntax of specified command
:'''<code>help [command]</code>''' - shows available commands or syntax of specified command
:'''<code>dbpr record_name [0-9]</code>''' - displays fields and values for a given record
:'''<code>dbpr record_name [0-9]</code>''' - displays fields and values for a given record
Line 27: Line 52:
:'''<code>seqShow</code>''' - shows running sequence programs
:'''<code>seqShow</code>''' - shows running sequence programs
:'''<code>seqStop</code>''' - stops a running sequence program
:'''<code>seqStop</code>''' - stops a running sequence program
== Links ==
* [[https://wiki-ext.aps.anl.gov/blc/index.php?title=EPICS_101 EPICS 101]]
* [[https://wiki-ext.aps.anl.gov/blc/index.php?title=IOC_101 IOC 101]]

Latest revision as of 16:17, 17 March 2023

Channel Access command-lines

Channel Access (CA) allows users to interact with Process Variables (PV):

caget - get the value of one of more PVs
caput - change the value of a PV
camonitor - monitor the value of one or more PVs
cainfo - print info about a PV, including which host is running the IOC

Example:

$ caget kmp3:m1.VAL
kmp3:m1.VAL            60
$ caget kmp3:m1.{DESC,RTYP,DTYP}
kmp3:m1.DESC           theta motor
kmp3:m1.RTYP           motor
kmp3:m1.DTYP           asynMotor


Noteworthy fields

A Process Variable (PV) is a the field from a record:

PV = record_name + . + field_name

Most common fields:

VAL - the default field (used if no field is specified in the vast majority of cases)
SCAN - determines when a record processes
NAME - the record name (helpful if records are aliased)
DESC - record description
RTYP - the record type
DTYP - the device support type (not meaningful for all record types)
DISP - disable puts (ca = channel access & pva = pv access) from outside the IOC (when non-zero); e.g. disable a motor from the motorx_all screen
DISV/DISA/SDIS - disable record processing internally
  • Record processing is disabled when DISA equals DISV (e.g. uses SDIS field to read in a value/mode, which will disable some control if a certain mode is active)
  • DISA is set to the value of the PV in the SDIS field, if it isn't empty
TPRO - trace processing: when set to 1 prints out all the records that get processed after the record is processed; used only for troubleshooting

Note: some of the fields of a record are actually record attributes (they return the same value for all instances of the record type; see https://epics.anl.gov/)


IOC shell commands

To connect to (disconnect from) the IOC shell, see here:

help [command] - shows available commands or syntax of specified command
dbpr record_name [0-9] - displays fields and values for a given record
dbl - lists all records in an IOC
dbl record_type - lists all records of a specific type in an IOC
dbl record_type "field_list" - lists specified fields (space-separated list) of records of a specific type in an IOC
dbpf pv_name value - change a PV’s value – analogous to caput
dbgf pv_name - read a PV’s value – analogous to caget
epicsEnvShow - prints environment variables
seqShow - shows running sequence programs
seqStop - stops a running sequence program


Links