Using Keithley6487 instrument support in an application

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

  1. Add the full path to the Keithley6487 support directory to the application configure/RELEASE file:
    Keithley6487=xxxx/modules/instrument/keithley6487/<release>
    Where <release> is the release number of of the Keithley6487 support.
  2. Add stream and asyn support to application database definition file
    The application database definition file must include the database definition files for the stream package and for any needed ASYN drivers. There are two ways that this can be done:
  3. Add the stream and asyn support libraries to the application
    You must link the stream support library and the ASYN support library with the application. Add the following lines:
    xxx_LIBS += stream
    xxx_LIBS += asyn
    before the
    xxx_LIBS += $(EPICS_BASE_IOC_LIBS)
    in the application Makefile.
  4. Ensure that the devKeithley6487.proto StreamDevice protocol file is in a directory in the STREAM_PROTOCOL_PATH list.
  5. Load the Keithley6487 support database records in the application startup script:
    cd $(Keithley6487)      (cd Keithley6487 if using the vxWorks shell)
    dbLoadRecords("db/devKeithley6487.db,"P=<P>,R=<R>,PORT=<PORT>,A=<A>,NELM=<N>")
    You'll have to provide appropriate values for the PV name prefixes (<P> and <R>), the port name (<PORT>) and the device address (<A>). The port name must match the value specified in an ASYN drvxxxxxConfigure command.  The NELM parameter sets the size of the triggered acquisition waveform and defaults to 1000 if not present.

    Here are the salient commands from the example Keithley 6487 application:
    drvAsynIPPortConfigure("L0","moxa01:4002 COM",0,0,0)
    asynSetTraceIOMask("L0",-1,0x2)
    asynSetOption("L0", -1, "baud", "57600")
    asynSetOption("L0", -1, "bits", "7")
    asynSetOption("L0", -1, "parity", "even")
    asynSetOption("L0", -1, "stop", "1")
    asynSetOption("L0", -1, "crtscts", "N")
    dbLoadRecords "db/devKeithley6487.db" "P=$(P),R=1:,PORT=L0,A=-1,NELM=1000"
When the 6487 performs a MEASure? command it silently resets several parameters used by triggered acquisition.   When switching from ‘measure’ to ‘triggered’ acquisition you should process the $(P)$(R)RestoreTriggerSettings record to return the parameters to their desired values.

This module has been tested only with a serial connection to the instrument.   The GPIB interface has not been tested.

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 Keithley 6487 instruments connected to the IOC.

Several of the records have the characters 'RBV' at the end.   This indicates that they are the 'Read Back Value' corresponding to an output record with the same name minus the RBV.

IEEE-488.2 Records

Record
Name
Record
Type

Description
$(P)$(R)IDN waveform
Instrument identification string (FTVL=CHAR).  A waveform record must be used since the identification string is too long to fit into a stringin record.
$(P)$(R)RST
bo
Reset all settings to default values.
$(P)$(R)CLS
bo
Clear error message queue and all event register bits.
$(P)$(R)GetSTB
longin
Read system status byte register.
$(P)$(R)GetESR
longin
Read and clear the system event status register.
$(P)$(R)GetESE
$(P)$($)SetESE
longin
longout
Read/Write the system event status enable register.
$(P)$(R)GetSRE
$(P)$($)SetSRE
longin
longout
Read/Write the system service request enable register.
$(P)$(R)TRG
bo
Send a bus trigger to the instrument.
$(P)$(R)GetOPC
bi
Read the operation complete status.

The TRG and GetOPC record are not that useful since the 6487 does not process commands when in triggered acquisition mode.  For example, the operation complete status simply waits till the 6587 has acquired the full set of triggered samples and then reads back as 1.  Any other command (e.g. FETCH?) would have the same effect of waiting until the end of triggered acquisition and then returning.

Range Selection Records

Record
Name
Record
Type

Description
$(P)$(R)Range
$(P)$(R)RangeRBV
mbbo
mbbi
Set/get the full-scale range of the instrument (2 nA to 20 mA).
$(P)$(R)AutoRange
$(P)$(R)AutoRangeRBV
bo
bi
Set/get the status of the instrument auto-range operation.  A search of every available range is performed every time an autorange occurs.  This can significantly slow down data acquisition.

Measurement Records

Record
Name
Record
Type

Description
$(P)$(R)Measure ai
Send a ‘MEASure?’ command to measure and return the value of the current.
Note that this operation changes the settings of several triggering parameters.  To return to triggered operation process the $(P)$(R)RestoreTriggerSettings record.
$(P)$(R)FetchWF
waveform
Read back the samples acquired during the most recent triggered acquisition session.  This command does not trigger a measurement.  It simply requests the last group of readings.

Filtering Records

Record
Name
Record
Type

Description
$(P)$(R)IntegrationTime
$(P)$(R)IntegrationTimeRBV
ao
ai
The time (in units of power-line cycles) to sample data for a single measurement.
$(P)$(R)Damping
$(P)$(R)DampingRBV
bo
bi
The status of the instrument damping.  Damping helps reduce the noise resulting from large source or cable capacitance but slows down acquisition.
$(P)$(R)FilterEnable
$(P)$(R)FilterEnableRBV
bo
bi
The status of the instrument digital boxcar filter.
$(P)$(R)FilterCount
$(P)$(R)FilterCountRBV
longout
longin
The number of samples (2 to 60) in the instrument boxcar filter.

Triggered Acquisition Records

These affect triggered acquisition only.   The MEASure? command overrides these settings.

Record
Name
Record
Type

Description
$(P)$(R)ArmSource
$(P)$(R)ArmSourceRBV
mbbo
mbbi
The source which will arm the instrument when in triggered acquisition mode.
$(P)$(R)ArmTimerInterval
$(P)$(R)ArmTimerIntervalRBV
ao
ai
The time (seconds) between arm operations when arm source is ‘Timer’.
$(P)$(R)ArmLine
$(P)$(R)ArmLineRBV
mbbo
mbbi
The trigger link line (1 through 6) to be used  when arm source is ‘Trigger Link’.
$(P)$(R)ArmCount
$(P)$(R)ArmCountRBV
longout
longin
The number of arm operations in a completed triggered acquisition sequence.
 $(P)$(R)TriggerSource
$(P)$(R)TriggerSourceRBV
mbbo
mbbi
The source which will trigger the instrument when in triggered acquisition mode and armed.
$(P)$(R)TriggerLine
$(P)$(R)TriggerLineRBV
mbbo
mbbi
The trigger link line (1 through 6) to be used  when trigger source is ‘Trigger Link’.
$(P)$(R)TriggerDelay
$(P)$(R)TriggerDelayRBV
ao
ai
Delay (seconds) from trigger to  data acquisition.
$(P)$(R)TriggerDelayAuto
$(P)$(R)TriggerDelayAutoRBV
bo
bi
Set trigger delay based on range or used fixed ($(P)$(R)TriggerDelay) value.
$(P)$(R)TriggerCount
$(P)$(R)TriggerCountRBV
longout
longin
The number of trigger operations in a single arm cycle of a triggered acquisition sequence.
$(P)$(R)Start bo
When this record is processed a triggered acquisition sequence will be initiated.  No other commands will complete until the sequence has finished or been canceled.
$(P)$(R)Cancel bo
When this record is processed a triggered acquisition sequence will be canceled.
$(P)$(R)RestoreTriggerSettings seq
Process all the triggering control records to write the settings back to the instrument.  This is necessary when switching from ‘MEASure?’ to triggered acquisition.
$(P)$(R)ReadTriggerSettings seq
Process all the triggering control readback records.

Local Controls Records

Record
Name
Record
Type

Description
$(P)$(R)KLOCK
$(P)$(R)KLOCKRBV
bo
bi
Lock out the instrument front-panel controls.  When set all front-panel controls, including the LOCAL button, are disabled.

Voltage Source Records

Record
Name
Record
Type

Description
$(P)$(R)SourceEnable
$(P)$(R)SourceEnableRBV
bo
bi
Voltage source off/on.
$(P)$(R)SourceInterlock
$(P)$(R)SourceInterlockRBV
bo
bi
Disable/enable external interlock when in 10V range.  The external interlock is always enabled in the 50V and 500V ranges.  The readback value is 1 when the interlock is enabled and the external interlock chain is open.
$(P)$(R)SourceRange
$(P)$(R)SourceRangeRBV
mbbo
mbbi
Voltage source range (10V, 50V, 500V).
$(P)$(R)SourceIlimit
$(P)$(R)SourceIlimitRBV
mbbo
mbbi
Current limit (25 uA, 250 uA, 2.5 mA, 25 mA).  The 25 mA limit is available only when the source is in the 10V range.
$(P)$(R)SourceVoltage
$(P)$(R)SourceVoltageRBV
ao
ai
Voltage source setpoint and setpoint readback.  The setpoint must be resent after an interlock fault.  Turning the source off/on is not sufficient.
$(P)$(R)SourceReadSettings seq
Process all the voltage source readback records.


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/keithley6487.
  2. Place the distribution file into this directory.
  3. Execute the following commands:
    cd modules/instrument/keithley6487
    gunzip keithley6487<release>.tar.gz
    tar xvf keithley6487<release>.tar
    cd <release>
    Where <release> is the release number of of the Keithley6487 support.
  4. Edit the configure/RELEASE file and set the paths to your installation of EPICS base, stream and ASYN support modules.
  5. Execute make in the top level directory.