Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
6-asyn-troubleshooting.md 10.35 KiB

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:

  1. Launch caQtDM if it isn't already running
$ ./softioc/xxx.sh caqtdm

This launches my-xxx.ui:

screenshot of my-xxx.ui showing the default Motors section

  1. Switch to the Direct I/O section of my-xxx.ui

screenshot of my-xxx.ui showing the "Direct I/O" section

  1. From the Serial 1-8 menu of my-xxx.ui, choose asyn record serial1

This launches asynOctet.ui:

screenshot of asynOctet.ui

Note: the terminators should remain empty for now. They'll be corrected in step 6.4

  1. From the More... menu of asynOctet.ui, choose Record Parameters

This launches asynRecord.ui:

screenshot of 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.

6.3 Observe controller communication