forked from epics-modules/iocStats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README_iocAdmin
206 lines (160 loc) · 7.94 KB
/
README_iocAdmin
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
Instructions for iocAdmin users Last Updated 12/05/2012
--------------------------------
The iocAdmin package contains databases and libraries to add ioc administration
PVs (including STARTTOD (ioc start time), TOD (time-of-day that updates
every second), SYSRESET (ioc restart command), access security PVs, etc) to an
ioc application. This package includes general time records and IOC stats
(devIocStats) - see README_devIocStats for detail.
iocAdmin also provides access.db, a database template defining records for
device attributes that are common across many IOC applications. See I-5
below for more detail.
I - Adding the iocAdmin package to your IOC application:
-------------------------------------------------------
(1) Add IOCADMIN to configure/RELEASE and clean/rebuild configure:
IOCADMIN=/afs/slac/g/lcls/epics/modules/iocAdmin/iocAdmin-R<release>
(2) Link the iocAdmin libraries into your app by adding to
<xxx>App/src/Makefile:
<xxx>_LIBS += devIocStats
(3) Add the following .dbd files to <xxx>App/src/Makefile
or to <xxx>App/src/<xxx>Include.dbd:
<xxx>_DBD += iocAdmin.dbd
(4) Install the iocAdmin database and create iocRelease.db by adding to
<xxx>App/Db/Makefile:
DB_INSTALLS += $(IOCADMIN)/db/iocAdminVxWorks.db (VxWorks IOCs)
DB_INSTALLS += $(IOCADMIN)/db/iocAdminRTEMS.db (RTEMS IOCs)
DB_INSTALLS += $(IOCADMIN)/db/iocAdminSoft.db (soft IOCs)
DB_INSTALLS += $(IOCADMIN)/db/access.db (if required by next step)
DB_INSTALLS += $(IOCADMIN)/db/iocAdminScanMon.db (optional - ONLY if SCAN
monitoring is required)
IOCRELEASE_DB += iocRelease.db
NOTE: The iocRelease database assumes that each
module used by the application has a line in configure/RELEASE as follows:
<module>_MODULE_VERION = <module>-<version>
It also assumes that modules are not specified in any file included
by configure/RELEASE.
(5) For each device, or device attribute, used by higher-level software
(ie, feedback), an ACCESS mode and FBCK state soft mbbo records are
required and used by the higher-level software to determine proper
configuration and display. Both records must be saved and restored
across IOC restart. Currently, devices requiring these records include
beamline devices (ie, BPMs, bunch length monitors, toroids, faraday cups,
PMTs, wire-scanners, collimators, power meters, gun RF, klystrons,
cavities, and magnets). These records may be required per device channel
or device attribute instead of per device, depending on the needs of the
higher-level software.
The ACCESS record has state names of Online, Maintenance, Checkout, and
Offline and is set by operations. It is not meant to be used by Channel
Access Security or for the actual device state which is set using a
different record name by the IOC itself. See iocAdmin/Db/access.doc
for requirements and discussion of the ACCESS record.
The FBCK record has state names of Off, On, and Unavailable.
"Unavailable" indicates the device is not used by any feedback loop and
this value is set by operations. "On" is set when ANY feedback loop is
using the device, and "Off" is set when ALL feedback loops are NOT using
the device. "Off" requires feedback loops to know about each other or
some sort of feedback loop management.
To create this record, make sure access.db template file is installed
(see the previous the step) and include access.db in your device
substitutions file for every device as follows:
file access.db
{
pattern { DEV }
{ <device or attribute name including ALL colons> }
}
See iocAdmin/Db/access.doc for requirements and discussion.
II - Adding iocAdmin to your IOC startup file:
-----------------------------------------------
(1) Add the following environment variables to st.cmd:
All IOCs (must be less than 40 characters):
epicsEnvSet("ENGINEER","<yourname>")
epicsEnvSet("LOCATION","<ioclocation>")
Soft IOCs only (can be longer than 40 characters):
epicsEnvSet("STARTUP","/usr/local/lcls/epics/iocCommon/<iocname>")
epicsEnvSet("ST_CMD","startup.cmd")
(2) Add iocAdmin database to st.cmd (before iocInit):
VxWorks IOCs only:
dbLoadRecords("db/iocAdminVxWorks.db", "IOC=<iocname>")
RTEMS IOCs only:
dbLoadRecords("db/iocAdminRTEMS.db", "IOC=<iocname>")
Soft IOCs only:
dbLoadRecords("db/iocAdminSoft.db", "IOC=<iocname>")
(3) Add iocRelease database to st.cmd (before iocInit):
dbLoadRecords("db/iocRelease.db", "IOC=<iocname>")
(4) If SCAN monitoring is required (most IOCs do not require these
records - discuss with Kukhee Kim first):
dbLoadRecords("db/iocAdminScanMon.db", "IOC=<iocname>")
III - Adding iocAdmin to CA Clients:
------------------------------------
(1) Channel Watcher:
(1a) Alarm Limits - Macros are not provided for IOC health alarm limits in
iocAdmin.db. Alarm limits must be added to the channel watcher
configuration file instead. The IOC channel access security state
should also be added. Use this template to create the
<ioc>.cwConfig file:
RTEMS and VxWorks IOCs only:
$(IOCADMIN)/restore/iocAdmin.cwConfig
Soft IOCs only:
$(IOCADMIN)/restore/iocAdminSoft.cwConfig
(1b) IOC Startup Counter - <iocname>:START_CNT keeps a count of the
number of times the ioc has started up. In order for it to
work properly, the record must be saved and restored across
ioc startup. It is included in the above templates.
(1c) Device-Specific Records - For every device instantiating the
access.db database, add these lines to the channel watcher
configuration file:
<device name including ALL colons>ACCESS /LOG
<device name including ALL colons>FBCK /LOG
(2) EDM:
(2a) For a new version of iocAdmin, copy or merge required display files
from $(IOCADMIN)/display to $EDM/misc.
(2b) IOC Display - Choose the correct machine area for the IOC and add
the ioc to the proper network EDM displays:
$EDM/lcls/ntwk_<area>_main.edl
$EDM/lcls/ntwk_<area>_iocstatus.edl
Use the proper related display depending on the type of IOC:
ioc_rtems_acsw - RTEMS IOC using an AC switch to power cycle.
ioc_rtems_crat - RTEMS IOC using the crate interface to power cycle.
ioc_rtems_none - RTEMS IOC without a crate interface or AC switch.
ioc_rtems_nosupport - RTEMS IOC with a unsupported crate interface
ioc_rtems_camac_4crat, ioc_rtems_camac_5crat, ioc_rtems_camac_6crat, or
ioc_rtems_camac_crat - RTEMS IOC with camac crate(s).
ioc_soft - Soft IOC
Set the "ioc" macro to the ioc database name.
(2c) Device-Specific Display - For each device instantiating the access.db
database, add choice or menu buttons for ACCESS and FBCK on the
device single-unit diagnostic display and/or subsystem display
showing the device status.
(3) Channel Archiver - for each IOC, consider adding some or all of the
following records to Channel Archiver:
All IOCs:
<iocname>:CA_CLNT_CNT
<iocname>:CA_CONN_CNT
<iocname>:FD_FREE
<iocname>:START_CNT
RTEMS and VxWorks IOCs only:
<iocname>:MEM_FREE
<iocname>:MEM_BLK_FREE
<iocname>:SYS_MBUF_FREE
<iocname>:RAM_WS_FREE
<iocname>:IOC_CPU_LOAD
<iocname>:IFI_ERR_CNT
<iocname>:IFO_ERR_CNT
<iocname>:CLUST_1_0_2
<iocname>:CLUST_1_1_2
(4) Alarm Handler - add logic for the IOC heartbeat (that creates the
HEARTBEATSUM record) to the ALH soft IOC (via email to Judy Rock). Add
the IOC to the "NETWORK" subgroup for all applicable machine areas with
the following PVs and include them in <iocname>:STATSUMY on the ALH soft
IOC:
All IOCs:
<iocname>:CA_CLNT_CNT
<iocname>:CA_CONN_CNT
<iocname>:SUSP_TASK_CNT
<iocname>:FD_FREE
<iocname>:IOC_CPU_LOAD
<iocname>:HEARTBEATSUM (from the ALH soft IOC)
<iocname>:GTIM_ERR_CNT
RTEMS and VxWorks IOCs only:
<iocname>:MEM_FREE
<iocname>:MEM_BLK_FREE
<iocname>:RAM_WS_FREE