C++ Base Class for Asyn Port Clients

November 16, 2014

Mark Rivers

University of Chicago

asynPortClient is a set of C++ classes that are designed to simplify the task of writing a client that directly communicates with an asyn port driver, without running an EPICS IOC. They handle the details of connecting to the driver, finding the required interfaces, etc. They only use the synchronous interfaces, so all calls are blocking. If clients need asynchronous operation then they can use the normal C interface with pasynManager->queueRequest.

asynPortClient provides a base class, asynPortClient, from which interface-specific class are derived. It also provides a class for each of the standard asyn interfaces, (asynInt32, asynFloat64, asynCommon, asynEnum, etc.).

The detailed documentation for asynPortClient is in these files (generated by doxygen):

The example driver in asyn (testAsynPortClient) is a simple example of how to use this class.

Another example can be found in ADCore/iocs/simDetectorNoIOC found in the areaDetector module.

Example client - testAsynPortClient

An example client using the asynPortClientclass is provided in the testAsynPortClientApp application in asyn. This tests running C++ applications that communicate with asyn port drivers without running an IOC. This currently contains a single test application, testAsynIPPortClient.cpp. This program creates an asynIPPort driver, and uses the command line arguments to set the hostInfo string, a single command string to send to the server, and optionally the input and output EOS. It then prints out the response from the server. There are 3 example shell scipts that show how to use testAsynIPPortClient to communicate with a Web server, XPS motor controller, and a telnet host respectively.