IOC Deployment and Troubleshooting
6 asyn troubleshooting
The EPICS asyn module provides a trace facility that allows communication between an IOC and a controller to be displayed or logged.
6.1 Start the IOC
$ cd ${IOC_DIR}/xxx/iocBoot/iocxxx
$ ./softioc/xxx.sh start
output
The script will prevent you from starting a second copy of an IOC.
xxx is already running (pid=1963381) in a screen session (pid=1963380)
6.2 How to enable asyn traces
Asyn traces can be enabled from the IOC's shell. An example of how to do this can be found in the example virtual motor controller configuration that was copied in a previous step:
# Only show errors
asynSetTraceMask("VMC_ETH", 0, 1)
# Leave ascii selected so traces can be turned on with a single click
asynSetTraceIOMask("VMC_ETH", 0, 1)
It is much easier, however, to enable asyn traces from MEDM/caQtDM if the IOC loaded at least one asyn record.
Do the following:
- Launch caQtDM if it isn't already running
$ ./softioc/xxx.sh caqtdm
This launches my-xxx.ui:
- Switch to the Direct I/O section of my-xxx.ui
- From the Serial 1-8 menu of my-xxx.ui, choose asyn record serial1
This launches asynOctet.ui:
Note: the terminators should remain empty for now. They'll be corrected in step 6.4
- From the More... menu of asynOctet.ui, choose Record Parameters
This launches asynRecord.ui:
The traceMask determines which messages are printed on the IOC's console:
- traceError should always be on
- traceIODriver is useful for looking at serial/ethernet communication (when connected to the correct asyn port)
The traceIOMask deterines how the messages are printed on the IOC's console:
- traceIOASCII prints the messages as ASCII strings (this works well for messages that only include symbols that appear on a keyboard)
- traceIOEscape prints the messages and unprintable characters using escape sequences (starting with a backslash)
- traceIOHex prints the messages as a series of byte values in hexadecimal (without the 0x prefix)
Note: input and output message terminators are usually unprintable characters like carriage return, \r or 0x13, and line feed, \n or 0x10.