(D)evice (EX)plorer
Command line access to FESA Devices (for
DevAcc devices routing to prophelper output) based on Udo Krauses Python-interface for CMW.
Flavours
dex comes in different flavours:
- pdex -> Accessing the devices through the (P)roductive environment.
- ddex -> Accessing the devices through the (D)evelopment environment.
- idex -> Accessing the devices through the (I)evelopment environment.
Device Explorer uses Python module cmwrda.which requires the options -e(int|dev|pro) as options. To get rid of this option djungle dex can be called in its different flavours
In the following dex will be used to refer to both.
Easiest example
ddex YR03KD1D # Access Status property of device YR03KD1D
For more sophisticated examples see below.
Usage
Check for latest usage informations using option -h.
(i|d|p)dex -h
Examples
pdex YR03KD1D # Access Status property of device
idex YR03KD1D Setting -s p3 # Access Setting property with selector BP = 3
idex YR03KD1D S # Use shortform of 'Setting' to access property
ddex YR03KD1D Acquisition -s p3:7 # Access Acquisition property for the BPs 3 to 7
pdex YR03KD1D -i -m # Subscribe to Status, Setting and Acquisition property (-m for monitoring)
pdex YR03KD1D -scanlsa # Ask LSA which BPs should have been supplied with data
idex YR03KD1D -n # Show all 'neighboring' devices residing on the same DU
ddex scuxl0244 # Show all devices on frontend
ddex scuxl0244 Acquisition -u # Accesses Acquisition property of all devices on frontend
ddex -h # Get awesome help
Access via batch files
dex is able to process batch files to manage reoccuring tasks with several device accesses. Batch files for the device explorer end with "
.dex". Calling dex with option
-f reads and executes the batchfile:
dex -f myfile.dex
IMPORTANT: Every dex-command needs it's own line.
Syntax for
reading:
DEV mydev
DEV mydev PROP myprop
DEV mydev PROP myprop ITEM myitem
Syntax for
writing (Only double values accepted until now):
DEV mydev PROP myprop ITEM myitem=0.815
Syntax for
other things:
DEV mydev ONLINE # reads Status property and evaluates opReady
SLEEP 1.23 # waits 1.23 seconds
#Comments
Example:
# Nice comment for a nice example
DEV YR00MH PROP Power
DEV YRT1KH1 PROP Setting ITEM current
SLEEP 1.2
# Best comment ever!!!!!!1111einself
DEV YR0815 ONLINE
Feature requests / BUGs
- ability to handle selectors including sequences, e.g. -s s1p0. error messages:
matthies@asl744 workspacepLinacLLRF $ ddex LLRF_Device_02 TimingEventsAcquisition -a -s p0 NOMEN = LLRF_Device_02 (PLinacLLRF_DU.lorfllrfpli02 | PLinacLLRF) TIMDOM = PZU_QL (449)
|
TimingEventsAcquisition
Please report - UNKNOWN FESA ERROR (to [[mailto:m.wiebel@gsi.de][m.wiebel@gsi.de]]): USER_ERROR: Error caused by: FESA_GSI_3022 The selector: 'FAIR.SELECTOR.P=0' doesn't provide a sequence index. Device 'LLRF_Device_02' is sequence-multiplexed and requires a sequence-index to perform get/set operations.. src/fesa-core-gsi/Server/Property.cpp:173
device="LLRF_Device_02" property="TimingEventsAcquisition" selector="FAIR.SELECTOR.P=0" requestType="GET"
matthies@asl744 workspacepLinacLLRF $ ddex LLRF_Device_02 TimingEventsAcquisition -a -s s1p0 NOMEN = LLRF_Device_02 (PLinacLLRF_DU.lorfllrfpli02 | PLinacLLRF) TIMDOM = PZU_QL (449)
|
TimingEventsAcquisition
Please report - UNKNOWN FESA ERROR (to [[mailto:m.wiebel@gsi.de][m.wiebel@gsi.de]]): USER_ERROR: Error caused by: FESA_GSI_3022 The selector: 'FAIR.SELECTOR.P=0' doesn't provide a sequence index. Device 'LLRF_Device_02' is sequence-multiplexed and requires a sequence-index to perform get/set operations.. src/fesa-core-gsi/Server/Property.cpp:173
device="LLRF_Device_02" property="TimingEventsAcquisition" selector="FAIR.SELECTOR.P=0" requestType="GET"
- First of all, mark implemented features with and describe shortly how they must be used.
- enable to pass filter for filtered properties (specifically strings) [TH]
- possiblity to draw functions from coeff-arrays [maw - pkain]
- option (e.g.
--force
) to don't stop output on error but to continue with next device (in *.dex file) [LH]
- option for single line output with *.dex file, e.g. not
NOMEN = GTV2MU2
|
Status
|-- opReady = True
NOMEN = GTV2MU3
|
Status
|-- opReady = False
...
but
GTV2MU2 Status.opReady = True
GTV2MU3 Status.opReady = False
...
May be difficult for several items. [LH]
- defining two items like
DEV GHHTMU1 PROP Status ITEM opReady ITEM status
in a *.dex file does not lead to an error, but only the last item (status
in this case) is put out. [LH]
- option to pass one or more parameters to the *.dex file, e.g. to switch power on or off the *.dex file would look (in pseudo bash syntax) like
DEV GTK1MU1 PROP Power ITEM power=${p1}
DEV GTK1MU2 PROP Power ITEM power=${p1}
...
and the command line pdex -f myfile.dex 1
or so to switch the power on for all devices. [LH]
- when an acquisition property was read, output the multiplexing context as well [LH]
- perhaps controlled via an option; one may not want the mux context in any case
- format the output; each field of the event pattern (format, flags, sid, bpid, event, readable timestamp, ...); see Format of a Timing Message
- Monitor with
pdex GTV2QD11 -i -m3 -s p2
works, but not with pdex GTV2QD11 Acquisition -m3 -s p2
. [LH]
- Access the
Configuration
property with pdex -c YR02KD
does not yet work. [LH]
- Access the
Configuration
property without DB access does not yet work as well. [LH]
asl743$ pdex -x PowerSupplyCry_DU.scuxl0145 YR02KD Configuration NOMEN = YR02KD | Configuration |-- ERROR: Device 'YR02KD' has no property named 'Configuration'. |-- Try one of: |-- Acquisition |-- Connect ... |-- Version
- Output the properties' value-items as well. Suggestion:
pdex -l YR02DC1
lists all properties (which is already the case) and pdex -l YR02DC1 Setting
lists all value-items of the property Setting. [LH]