Introduction

This module provides support to control SRS CG635 clock generators using their GPIB or RS-232 interfaces.

Using SRS CG635 support in an application

Several files need minor modifications to use this support in an application.

  1. Add the full path to the SRS CG635, Stream Device and ASYN support directories to the application configure/RELEASE file:
    STREAMDEVICE = xxxx/modules/soft/stream<release>
    ASYN         = xxxx/modules/soft/asyn<release>
    CG635        = xxxx/modules/analog/srsCG635<release>
    Where <release> is the release number of of the support.
  2. Add support to application database definition file
    The application database definition file must include the database definition files for the Stream Device and ASYN support.  There are two ways that this can be done: If you are using the CG635 GPIB interface replace the drvAsynIPPort.dbd with the appropriate file (drvVxi11.dbd, etc.).
  3. Add the Stream Device and ASYN support libraries to the application by adding the  lines
    xxx_LIBS += stream
    xxx_LIBS += asyn
    before the
    xxx_LIBS += $(EPICS_BASE_IOC_LIBS)
    in the application Makefile.
  4. Specify the srsCG635 device in the application startup script file.  For example, if using an RFC2217 Ethernet/RS-232 adapter:
    drvAsynIPPortConfigure("<PORT>", "<address>:<port number> COM",0,0,0)
    asynSetOption("
    <PORT>", -1, "baud", "9600")
    asynSetOption("
    <PORT>", -1, "bits", "8")
    asynSetOption("
    <PORT>", -1, "parity", "none")
    asynSetOption("
    <PORT>", -1, "stop", "1")
    asynSetOption("
    <PORT>", -1, "crtscts", "Y")
    asynOctetSetOutputEos("
    <PORT>",-1,"\r")
    asynOctetSetInputEos("
    <PORT>",-1,"\r")
  5. The SRS CG635 support module provides a Stream Device protocol file which must be placed in a spot where it can be found.  I put protocol files into my application “db” directory by adding a line like this
    DB_INSTALLS += $(CG635)/db/devsrsCG635.proto
    to the application xxx/Db/Makefile.
  6. The SRS CG635 support module provides an example database.  To use this add
    DB_INSTALLS += $(CG635)/db/devsrsCG635.db
    to the application xxx/Db/Makefile and add
    dbLoadRecords("db/devsrsCG635.db,"P=<P>,R=<R>,PORT=<PORT>,A=<ADDR>")
    to the application startup script.  You'll have to provide appropriate values for the PV name prefixes (<P> and <R>) and the port name(<PORT>). The instrument address should be set to -1 if you are using the RS-232 interface.  The port name must match the value specified in the device configuration command. The instrument address (<ADDR>) should be set to -1 if you are using the RS-232 interface.

Database

The example database and EDM engineering screen provided as part of this support module prefix all record names with the macros “$(P)$(R)”.  Typically the $(P) macro would expand to a “per-IOC” string and the $(R) macro would expand to a string unique to each of the SRS CG635 instruments connected to the IOC.  You'll probably want to use the database and screen only as a starting point for developing your own customized versions.

Standard SCPI Records

Record
Name
Record
Type

Description
$(P)$(R)IDN
waveform
Instrument identification string.
$(P)$(R)RST bo
Reset the instrument.
$(P)$(R)CLS bo
Clear the instrument status registers.
$(P)$(R)GetSTB longin
Read the the serial poll status byte.
$(P)$(R)GetESR longin
Read the event status register.
$(P)$(R)GetESE
$(P)$(R)SetESE
longin
longout
Read/Write the event status enable register.   Bits set in this register cause the serial poll status byte ESB bit to be set when the corresponding bit is set in the event status register.
$(P)$(R)GetSRE
$(P)$(R)SetSRE
longin
longout
Read/Write the service request enable register.   Bits set in this register cause a service request when the  corresponding bit is set in the serial poll status register.
$(P)$(R)GetOPC
longin
Read the state of the instrument operation complete flag which is set when all prior commands have completed.


SRS CG635 Records

Record
Name
Record
Type

Description
$(P)$(R)GetTimebase mbbi
Read the type of timebase installed in the instrument.
$(P)$(R)GetFreq
$(P)$(R)SetFreq
ai
ao
Read/Write the frequency of the generated signal (Hz).
$(P)$(R)GetStdCMOS
$(P)$(R)SetStdCMOS
mbbi
mbbo
Read/Write the levels of the CMOS output.  A readback value of -1 indicates that the CMOS output levels do not correspond to one of the standard levels.
$(P)$(R)Get0CMOS
$(P)$(R)Set0CMOS
$(P)$(R)Get1CMOS
$(P)$(R)Set1CMOS
ai
ao
ai
ao
Read/Write the CMOS output levels corresponding to a logic 0/1.  Terminating the CMOS output in 50Ω will reduce the voltages to half the specified values.
$(P)$(R)GetStdQ
$(P)$(R)SetStdQ
mbbi
mbbo
Read/Write the levels of the Q/Q* outputs.  A readback value of -1 indicates that the Q/Q* output levels do not correspond to one of the standard levels.
$(P)$(R)Get0Q
$(P)$(R)Set0Q
$(P)$(R)Get1Q
$(P)$(R)Set1Q
ai
ao
ai
ao
Read/Write the Q/Q* output levels corresponding to a logic 0/1. 
$(P)$(R)GetRunState
$(P)$(R)SetRunState
bi
bo
Read/Write the instrument run state (0-stopped, 1-running).
$(P)$(R)GetStopLevel
$(P)$(R)SetStopLevel
longin
longout
Read/Write the logic level to which the outputs will be driven when the instrument is stopped.  Writing a value of 2 will toggle the level.


Installation and Building

After obtaining a copy of the distribution, it must be installed and built for use at your site.
  1. Create an installation directory for the module. The path name of this directory should end with modules/instrument/srcCG635.
  2. Place the distribution file into this directory.
  3. Execute the following commands:
    cd modules/instrument/srsCG635
    tar xfz srsCG635<release>.tar.gz
    cd <release>
    Where <release> is the release number of of the srsCG635 support.
  4. Edit the configure/RELEASE file and set the paths to your installation of EPICS base and the StreamDevice and ASYN support modules.
  5. Execute make in the top level directory.

Legalese

Copyright (c) 2011  Lawrence Berkeley National Laboratory, Accelerator Technology Group, Engineering Division
This file is distributed subject to a Software License Agreement found in the file LICENSE that is included with this distribution.