Introduction

This support module provides ASYN drivers to control Caen A36xx power supplies.  The module consists of C source and and example database.  The support could use StreamDevice if not for the complex way that the supply handles waveform data.

Using Caen A36xx support in an application

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

  1. Add the full path to the Caen A36xx support directory to the application configure/RELEASE file:
    A36XX=xxxx/modules/bus/CaenA36xx/<release>
    Where <release> is the release number of of the Caen A36xx support. You'll need to provide a similar line for the ASYN support module.
  2. Add instrument support to application database definition file
    The application database definition file must include the database definition files for the Caen A36xx. There are two ways that this can be done:
  3. Add the devCaenA36xx support libraries to the application
    You must link the devCaenA36xx support library and the ASYN support library with the application. Add the following lines to the application Makefile:
    xxx_LIBS += devCaenA36xx
    xxx_LIBS += asyn
    before the
    xxx_LIBS += $(EPICS_BASE_IOC_LIBS)
  4. Add a devCaenA36xxConfigure command to the application startup script for eachA36xx supply:
           devCaenA36xxConfigure("L00", "someHost:10001", 0, 0)
    The arguments are the ASYN port name, the host address and TCP port of the A36xx supply, a flag word and the priority at which the port threads will run.    The default values chosen when any of the latter two arguments are 0 or missing are 0 and medium priority, respectively.    If the least-significant bit in the flags word is set statistics on the duration of each command/reply will be kept and displayed by the asynReport command.
  5. Load a database file or files describing the records associated with each A36xx supply. The example application distributed with this support module illustrates how this is done.

Database Development

String Input Records

Set DTYP=asynOctet, INP="@asyn($(PORT) xxx)", where $(PORT) expands to the port name in the devCaenA36xxConfigure command and xxx is a numeric value  as described in the following table.

ASYN
Subaddress
Description
26
Calibration date (EEPROM cell 26).
50–57
Interlock 1–8 identification.
100
Version information read from A36xx supply.

String Output Records

Set DTYP=asynOctet, OUT="@asyn($(PORT) xxx)", where $(PORT) expands to the port name in the devCaenA36xxConfigure command and xxx is a numeric value  as described in the following table.

ASYN
Subaddress
Description
50–57
Interlock 1–8 identification.  Write operations are accepted only when a valid password has been received.
101
Password to A36xx to enable subsequent parameter changes.

Binary Input Records

 Set DTYP=asynInt32 and INP="@asyn($(PORT) xxx)", where $(PORT) expands to the port name in the devCaenA36xxConfigure command and xxx is a numeric value as described in the following table.   Subaddresses less than 50 must be SCAN="I/O Intr".

ASYN
Subaddress
Description
0
Supply on
1
Generic fault
2
Generic warning
3
Local (1) / Remote (0)
4
DSP error
5
Overcurrent
6
Crowbar
7
MOSFET temperature too high
8
Shunt temperature too high
9
DC voltage too low
10
Ground current status
11
Regulator fault
12
Supply is ramping
13
Supply is shutting down
14
Supply is outputting waveform
15
Ripple fault
16–23
External interlock 1–8
24
Bulk supply on
26
Ground fault status
70
Slew control status (0-Immediate, 1-Rate Limit).  This record is typically SCAN=Passive and has an FLNK from the slew control record.
99
Readback poll.  Processing this record initiates a status read operation and updates the status bits and measured current.  This record is typically processed at one of the standard scan rates.  For faster status updates this record can be processed by a state notation program or a sequence record.

Analog Input Records

Set DTYP=asynFloat64 and INP="@asyn($(PORT) xxx)", where $(PORT) expands to the port name in the devCaenA36xxConfigure command and xxx is a numeric value  as described in the following table.

ASYN
Subaddress
Description
101
Supply measured output current (Amps).    Must be SCAN="I/O Intr".                   
60 Bulk supply voltage.
61
MOSFET regulator temperature (degrees C).
62
Shunt temperature (degrees C).
63
Supply output voltage.
64
Ground current (Amps).

Binary Output Records

Set DTYP=asynInt32 and OUT="@asyn($(PORT) xxx)", where $(PORT) expands to the port name in the devCaenA36xxConfigure command and xxx is a numeric value as described in the following table.   Resetting faults or turning a supply on or off triggers a status and current read back operation.

ASYN
Subaddress
Description
80
Stop waveform output when processed.  The value written is unused.
100
Turn supply off (0) or on (1).
101
Reset latched faults when processed.  The value written is unused.
102
Enable (1) or disable (0) slew rate limiting.  This record typically has an FLNK to the slew status binary input record.
104
Enable (1) or disable (0) the bulk supply.  The bulk supply is turned off only when all supplies have requested that it be disabled.

Analog Output Record

Set DTYP=asynFloat64 and OUT="@asyn($(PORT) xxx)", where $(PORT) expands to the port name in the devCaenA36xxConfigure command and xxx is a numeric value as described in the following table.  Subaddresses less than 100 are  EEPROM cell numbers.

ASYN
Subaddress
Description
100
Supply setpoint (Amps).  Processing this record sets the supply setpoint and performs a status and current read back operation.

Waveform Output Record

Set DTYP=asynIntFloat32ArrayOut and OUT="@asyn($(PORT) xxx)", where $(PORT) expands to the port name in the devCaenA36xxConfigure command and xxx is a numeric value as described in the following table.

ASYN
Subaddress
Description
0
The array of setpoints to be written, one per millisecond, when waveform output is enabled.

Long Output Record

Set DTYP=asynInt32 and OUT="@asyn($(PORT) xxx)", where $(PORT) expands to the port name in the devCaenA36xxConfigure command and xxx is a numeric value as described in the following table.

ASYN
Subaddress
Description
81
Set the number of cycles of waveform output.  The supply starts waveform output whenever this record is processed.  The example database shows how to provide separate 'start', 'stop' and 'set count' operations.

EEPROM Analog Input/Output Records

Set DTYP=asynFloat64 and INP or OUT="@asyn($(PORT) xxx)", where $(PORT) expands to the port name in the devCaenA36xxConfigure command and xxx is the EEPROM address as described in the following table.  Write operations to addresses other than the gains and slew rate are accepted only when a valid password has been received.

ASYN
Subaddress
Description
4
Maximum supply current.
13
Controller proportional gain.
14
Controller integral gain.
15
Controller derivative gain.
20
Maximum MOSFET heatsink temperature (degrees C).
21
Maximum shunt resistor temperature (degrees C).
23
Under-voltage protection threshold.
30
Output slew rate (A/s).
31 AH401B Users Manual Maximum earth leakage current limit.
37
Maximum allowable regulation fault current.
39 AH401B Users Manual Maximum allowable current ripple.
48
Interlock enable bitmap.  Bit 0-7=Interlock 1-8.  0/1=Disable/Enable.
49
Interlock activation bitmap.  Bit 0-7=Interlock 1-8.  0/1=Trip when open/shorted.
50–57
Interlock 1–8 response time (ms).

Database

The example application distributed with this support module comes with databases containing all the above process variables and EDM screens to display them.

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

Power Supply Configuration

To be used with this driver the  network interface in the supply must be configured to use TCP communication.  To allow setpoint changes faster than 40 Hz or so  the network interface in the supply must be configured to use a carriage-return character ('\r', hex 0x0D) as a trigger.   This can be changed from the network interface web server or from the network interface telnet server (port 9999).   The value is set in the ¨Match Bytes¨ field of the web server as shown below.

SerialSettings.png

If using the telnet server to make the change the terminal session will look something like the following.

> telnet 192.168.1.51 9999
MAC address 00204AC47B1C
Software version V6.6.0.2 (080926) XPTEXE

Press Enter for Setup Mode


*** basic parameters
Hardware: Ethernet TPI
IP addr 192.168.1.51, no gateway set,netmask 255.255.255.0
DNS Server not set

*** Security
SNMP is              enabled
SNMP Community Name: public
Telnet Setup is      enabled
TFTP Download is     enabled
Port 77FEh is        enabled
Web Server is        enabled
Web Setup is         enabled
ECHO is              disabled
Enhanced Password is disabled
Port 77F0h is        enabled

*** Channel 1
Baudrate 921600, I/F Mode 4C, Flow 00
Port 10001
Connect Mode : CC
Datagram Type 01
Pack Cntrl:   00
Remote IP Adr: --- none ---, Port 00000


*** Expert
TCP Keepalive    : 45s
ARP cache timeout: 600s
CPU performance: High
Monitor Mode @ bootup : enabled
RS485 tx enable  : active low
HTTP Port Number : 80
SMTP Port Number : 25
MTU Size: 1400
Alternate MAC: disabled
Ethernet connection type: auto-negotiate

*** E-mail
Mail server: 0.0.0.0
Unit       :
Domain     :
Recipient 1:
Recipient 2:

- Trigger 1
Serial trigger input: disabled
  Channel: 1
  Match: 00,00
Trigger input1: X
Trigger input2: X
Trigger input3: X
Message :
Priority: L
Min. notification interval: 1 s
Re-notification interval  : 0 s

- Trigger 2
Serial trigger input: disabled
  Channel: 1
  Match: 00,00
Trigger input1: X
Trigger input2: X
Trigger input3: X
Message :
Priority: L
Min. notification interval: 1 s
Re-notification interval  : 0 s

- Trigger 3
Serial trigger input: disabled
  Channel: 1
  Match: 00,00
Trigger input1: X
Trigger input2: X
Trigger input3: X
Message :
Priority: L
Min. notification interval: 1 s
Re-notification interval  : 0 s


Change Setup:
  0 Server
  1 Channel 1
  3 E-mail
  5 Expert
  6 Security
  7 Defaults
  8 Exit without save
  9 Save and exit            Your choice ? 1

Baudrate (921600) ?
I/F Mode (4C) ?
Flow (00) ?
Port No (10001) ?
ConnectMode (CC) ?
Datagram Type (01) ?
Send as Broadcast (N) ?
Remote IP Address : (000) .(000) .(000) .(000)
Remote Port  (0) ?
Pack Cntrl  (00) ?
SendChar 1  (00) ? 0d
SendChar 2  (00) ?

Change Setup:
  0 Server
  1 Channel 1
  3 E-mail
  5 Expert
  6 Security
  7 Defaults
  8 Exit without save
  9 Save and exit            Your choice ? 9

Parameters stored ...
Connection closed by foreign host.