Differences between revisions 32 and 37 (spanning 5 versions)
Revision 32 as of 2018-11-13 00:56:18
Size: 7772
Comment:
Revision 37 as of 2019-03-22 21:26:01
Size: 11942
Comment:
Deletions are marked like this. Additions are marked like this.
Line 4: Line 4:

Updated Mar 2019 Jon Richardson
Line 19: Line 21:
=== Configure Acromag XT modules ===

Initial configuration via USB is required before the units can be used on the network. This requires:
 * USB-to-miniUSB cable
 * Microsoft Windows (virtual) machine
 * Configuration Utilities: [[attachment:9500465D.zip]]

The above zip file contains the setup executable to install the configuration software for all different modules. Depending on the module, a different version of the utility needs to be launched after install. As during operation, the to-be-configured device needs to be powered by a 12-32V DC voltage source, either through the designated blue plug-in terminal on the bottom, or the clip-on dock on the rail.

On a virtual machine it may be necessary to open some ports to allow the guest OS to access the physical USB device

{{attachment:xt1XX1_config_screen1.png}}

==== Network Configuration ====

The primary screen looks identical for all models:

{{attachment:xt1XX1_config_screen1.png}}

Once the device is connected to the host via USB and the correct application has been launched, it will appear in the drop down menu.



||'''Hostname''' || '''Local IP''' ||
|| C1X-ADCYY || 192.168.11X.2Y ||
|| C1X-DACYY || 192.168.11X.4Y ||
|| C1X-BIOYY || 192.168.11X.6Y ||


=== Configure slow controls server machine ===

The following has proven to work with Debian Jessie running on a Supermicro SYS-5015A-H (Intel Atom processor without 64-bit support). This guide was written after-the-fact, so some steps may be missing. When configuring the next machine the gaps will be filled.

 * Fresh install of Debian Jessie
   * username: '''controls'''
   * optional: lightweight desktop environment '''LXDE'''

 * Give '''sudo''' privileges to '''controls'''
   * su
   * usermod -aG sudo controls

 * Set up SSH access
   * sudo apt-get install openssh-client
=== Configure auxiliary DAQ host machine ===

The following has proven to work with Debian Jessie (x64) on a Supermicro SYS-5017A-EP.

 * Fresh install of Debian Jessie (or most recent stable release)
   * Username: '''controls'''
   * Optional: lightweight desktop environment '''LXDE'''

 * Give '''sudo''' privileges to user '''controls'''
 {{{
su
usermod -aG sudo controls
  }}}

 * Set up SSH access
  * Run
  {{{
sudo apt-get install openssh-client
  }}}
  * Add lines "{{{search martian}}}" and "{{{nameserver 192.168.113.104}}}" to {{{/etc/resolv.conf}}}
  
Line 64: Line 43:
  * Edit /etc/network/interfaces   * Edit /etc/network/interfaces as follows:
  {{{
Line 80: Line 59:

||'''Ho
stname''' || '''Martian IP''' || '''Local IP''' ||
|| C1SUSAUX || 192.168.113.??? || 192.168.115.1 ||
|| C1AUXEX || 192.168.113.??? || 192.168.114.1 ||
|| C1AUXEY || 192.168.113.??? || 192.168.11?.1 ||
|| C1PSL || 192.168.113.??? || 192.168.11?.1 ||
|| C1VAC || 192.168.113.??? || 192.168.11?.1 ||
|| C1??? || 192.168.113.??? || 192.168.11?.1 ||
  }}}
  * XX i
s a placeholder for the machine's IP on the martian network
  * Y is pla
ceholder for the IP root of the local subnet
  ||'''Hostname''' || '''Martian IP''' || '''Local IP''' ||
  
|| C1SUSAUX || 192.168.113.??? || 192.168.115.1 ||
  || C1AUXEX || 192.168.113.??? || 192.168.114.1 ||
  || C1AUXEY || 192.168.113.??? || 192.168.11?.1 ||
  || C1PSL || 192.168.113.??? || 192.168.11?.1 ||
  || C1VAC || 192.168.113.??? || 192.168.11?.1 ||
  || C1??? || 192.168.113.??? || 192.168.11?.1 ||
Line 90: Line 71:
   * sudo apt-get install nfs-common

 * Set up systemd service for automatic start of the Modbus IOC

 * sudo apt-get install procserv
  * Run
  {{{
sudo apt-get install nfs-common
mkdir /cvs/cds
  }}}
  * Add line "{{{chiara:/home/cds /cvs/cds nfs rw,bg,nfsvers=3}}}" to end of {{{/etc/fstab}}} and run
 * Install procserv for proper detaching of Modbus IOC systemd service
 {{{
sudo apt-get install procserv
 }}}

=== Configure Acromag DAQ Modules ===

Initial configuration via USB is required before the units can be used on the network. This requires:
 * USB-to-miniUSB cable
 * Microsoft Windows (virtual) machine
 * Configuration Utilities: [[attachment:9500465D.zip]]

The above zip file contains the setup executable to install the configuration software for all different modules. Depending on the module, a different version of the utility needs to be launched after install. As during operation, the to-be-configured device needs to be powered by a 12-32V DC voltage source, either through the designated blue plug-in terminal on the bottom, or the clip-on dock on the rail.

On a virtual machine it may be necessary to open some ports to allow the guest OS to access the physical USB device.

In USB Settings:

{{attachment:VirtualBox_USB_Settings.png}}

add a corresponding filter:

{{attachment:Acromag_USB_Description.png}}

The vendor ID and product ID can be found via {{{lsusb}}}

==== Network Configuration ====

The primary screen of the configuration utilities looks identical for all models:

{{attachment:xt1XX1_config_screen1.png}}

Once the device is connected to the host via USB and the correct application has been launched, it will appear in the drop down menu. On the right the device IP and other network parameters can be set. Every host machine of the auxiliary DAQ acts as a node between the martian network and a local subnet to which the Acromag modules belong and which is not directly accessible from other machines on the martian network.

 * For consistency, the ADC, DAC, and BIO modules occupy different IP address spaces:
 ||'''Module''' || '''Local IP Address Space''' ||
 || ADC || 20-39 ||
 || DAC || 40-59 ||
 || BIO || 60-79 ||

 * Hostname and IP on the local network are assigned according to the following scheme:
 ||'''Hostname''' || '''Local IP''' ||
 || C1XXX-ADCYY || 192.168.11X.YY+20 ||
 || C1XXX-DACYY || 192.168.11X.YY+40 ||
 || C1XXX-BIOYY || 192.168.11X.YY+60 ||

 * Other settings (of no practical significance) are
  * Gateway is the local IP of the node machine
  * DNS is that of Chiara on the martian network: 192.168.113.104

{{attachment:xt1221_config_screen2.png}}

{{attachment:xt1541_config_screen2.png}}
Line 98: Line 133:
{{{
# Use the following commands for TCP/IP
# drvAsynIPPortConfigure(const char *portName, # user-defined: used for subsequent referencing,
# const char *hostInfo, # format: "IP-Address:Port". Standard port for Modbus is 502
# unsigned int priority, #
# int noAutoConnect, #
# int noProcessEos); #
#
# Examples:
# drvAsynIPPortConfigure("<TCP_PORT_NAME>","<UNIT_IP_ADDRESS>:502",0,0,1)
# drvAsynIPPortConfigure("c1auxex_xt1221a","192.168.114.11:502",0,0,1)
}}}


{{{
# modbusInterposeConfig(const char *portName, # reference to portName created with drvAsynIPPortConfigure command
# modbusLinkType linkType, #
# int timeoutMsec, # define timeout for waiting for response from unit
# int writeDelayMsec) #
#
# Example:
# modbusInterposeConfig("<TCP_PORT_NAME>",0,5000,0)
# modbusInterposeConfig("c1auxex_xt1221a",0,5000,0)
}}}

{{{
#drvModbusAsynConfigure(portName, # used by channel definitions in .db file to reference this unit)
# tcpPortName, # reference to portName created with drvAsynIPPortConfigure command
# slaveAddress, #
# modbusFunction, # defines driver function for the unit (read register = 4, write register = 6, write single coil = 5) - see examples in next section
# modbusStartAddress, # ADC and binary channel numbering starts with 0, DAC channel numbering with 1
# modbusLength, # length in dataType units - see examples in next section
# dataType, # 4 = 16-bit signed integers (for A/D and D/A), 0 = binary (for BIO, duh)
# pollMsec, # how frequently to request a value in [ms]
# plcType); #
#
# Example:
# drvModbusAsynConfigure("<PORT_NAME>","<TCP_PORT_NAME>",0,<modbusFunction>,<modbusStartAddress>,<modbusLength>,<dataType>,<pollMsec>,"Acromag")
}}}


==== XT1221 ====

{{{
drvModbusAsynConfigure("C1AUXEX_XT1221A_ADC","c1auxex_xt1221a",0,4,0,8,4,32,"Acromag")
}}}

==== XT1541 ====

{{{
drvModbusAsynConfigure("C1AUXEX_XT1541A_DAC","c1auxex_xt1541a",0,6,1,8,4,32,"Acromag")
drvModbusAsynConfigure("C1AUXEX_XT1541A_BIO","c1auxex_xt1541a",0,5,0,4,0,32,"Acromag")
}}}

==== XT1111 & 1121 ====

{{{
drvModbusAsynConfigure("C1AUXEX_XT1111A_BIO","c1auxex_xt1111a",0,6,0,4,0,32,"Acromag")
The EPICS binary {{{modbusApp}}} which launches the EPICS IOCs for the auxiliary DAQ system requires a {{{.cmd}}} instruction file which sets up the communication between the Acromag units and the EPICS IOC. The {{{.cmd}}} file is placed in {{{/cvs/cds/caltech/target/HOSTNAME/HOSTNAME.cmd}}}. It is largely similar to other EPICS binaries which launch an IOC, such as softIOC, with the addition that it can load the appropriate drivers for the modbus protocol prior to launching the IOC.

The file header consists of path definitions. At the current time there are no system variables pointing to these paths globally set, so the paths are explicitly defined.
{{{
epicsEnvSet("IOC", "c1XXX_iocconfig") # insert proper hostname for XXX
epicsEnvSet("ARCH","linux-x86_64")
epicsEnvSet("TOP","/cvs/cds/rtapps/epics-3.14.12.2_long/modules/modbus")
epicsEnvSet("MDBTOP","/cvs/cds/rtapps/epics-3.14.12.2_long/modules/modbus")
dbLoadDatabase("$(MDBTOP)/dbd/modbus.dbd")
modbus_registerRecordDeviceDriver(pdbbase)
}}}

Each Acromag unit requires a set of three instructions which define the driver and Modbus parameters for the handshake during communication.

{{{
drvAsynIPPortConfigure(const char *portName, # user-defined: used for subsequent referencing,
                       const char *hostInfo, # format: "IP-Address:Port". Standard port for Modbus is 502
                       unsigned int priority, #
                       int noAutoConnect, #
                       int noProcessEos); #

modbusInterposeConfig(const char *portName, # reference to portName created with drvAsynIPPortConfigure command
                      modbusLinkType linkType, #
                      int timeoutMsec, # define timeout for waiting for response from unit
                      int writeDelayMsec) #

drvModbusAsynConfigure(portName, # used by channel definitions in .db file to reference this unit)
                       tcpPortName, # reference to portName created with drvAsynIPPortConfigure command
                       slaveAddress, #
                       modbusFunction, # defines driver function for the unit (read register = 4, write register = 6, write single coil = 5) - see examples in next section
                       modbusStartAddress, # ADC and binary channel numbering starts with 0, DAC channel numbering with 1
                       modbusLength, # length in dataType units - see examples in next section
                       dataType, # 4 = 16-bit signed integers (for A/D and D/A), 0 = binary (for BIO, duh)
                       pollMsec, # how frequently to request a value in [ms]
                       plcType); #
}}}

==== Examples ====

A generic example sequence would be
{{{
drvAsynIPPortConfigure("<TCP_PORT_NAME>","<UNIT_IP_ADDRESS>:502",0,0,1)
modbusInterposeConfig("<TCP_PORT_NAME>",0,5000,0)
drvModbusAsynConfigure("<PORT_NAME>","<TCP_PORT_NAME>",0,<modbusFunction>,<modbusStartAddress>,<modbusLength>,<dataType>,<pollMsec>,"Acromag")
}}}

Note that the default values for the last instruction differ between the different XT DAQ modules.

ADC Module XT1221:
{{{
drvAsynIPPortConfigure("c1susaux_adc00","192.168.115.20:502",0,0,1)
modbusInterposeConfig("c1susaux_adc00",0,5000,0)
drvModbusAsynConfigure("C1SUSAUX_ADC00","c1susaux_adc00",0,4,0,8,4,32,"Acromag")
}}}

DAC (+4x BIO) Module XT1541:
{{{
drvAsynIPPortConfigure("c1susaux_dac00","192.168.115.40:502",0,0,1)
modbusInterposeConfig("c1susaux_dac00",0,5000,0)
drvModbusAsynConfigure("C1SUSAUX_DAC00","c1susaux_dac00",0,6,1,8,4,1,"Acromag")
drvModbusAsynConfigure("C1SUSAUX_DAC00_BIO","c1susaux_dac00",0,5,0,4,0,1,"Acromag") # Separate instruction for integrated BIO channels
}}}

BIO Modules XT1111 & XT1121:
{{{
drvAsynIPPortConfigure("c1susaux_bio00","192.168.115.60:502",0,0,1)
modbusInterposeConfig("c1susaux_bio00",0,5000,0)
drvModbusAsynConfigure("C1SUSAUX_BIO00","c1susaux_bio00",0,6,0,4,0,1,"Acromag")
}}}

After loading the drivers and setting up the modbus communication, the .cmd file instructs to load EPICS database files, just like other EPICS IOC starters. Like the {{{.cmd}}} file, the database files are located in {{{/cvs/cds/caltech/target/HOSTNAME}}}.
{{{
dbLoadDatabase("/cvs/cds/caltech/target/HOSTNAME/SUBSYSTEM.db")
Line 159: Line 209:
Note: Modbus/TCP is simply a protocol for sending commands via TCP that the XT units can interpret, as in read/write the correct register values to/from the channels. There may be multiple ways to define the channels have the same effect. The settings reported here have been found to work as intended.

Many of the fields in t
he EPICS records are somewhat supplemental and not required for the channel definitions, but some have real effect in MEDM screens, such as upper limits on slider bars and the such.


=====
XT1221 =====
{{{
field(INP,"@asynMask(<ADC_UNIT_PORT_NAME> 0 -16)MODBUS_DATA")
}}}


===== XT1541 =====

{{{
record(ao, "<AO_
CHANNEL_NAME>")
''Note: Modbus/TCP is simply a protocol for sending commands via TCP that the XT units can interpret, as in read/write the correct register values to/from the channels. There may be multiple ways to define the channels have the same effect. The settings reported here have been found to work as intended.''

T
he EPICS records in the {{{.db}}} files for the different DAQ channels are defined as follows (only fields relevant for proper addressing and conversion are shown):

----

'''
XT1221 ADC Channels:'''
{{{
record(ai,"C1:<CHANNEL_NAME>")
Line 176: Line 220:
        field(OUT,"@asynMask(<DAC_UNIT_PORT_NAME>, 0, -16)MODBUS_DATA")
}
}}}


{{{
record(bo, "<BO_CHANNEL_NAME>")
        field(INP, "@asynMask(<PORT_NAME> <X> -16)MODBUS_DATA") # <X>: 0-7 physical channel on Acromag unit
        field(LINR,"LINEAR") # For count to float conversion: The ADC module converts +/-10V inputs to +/-30,000 counts (if legacy support is disabled, +/- 20,000 counts otherwise)
        field(EGUF,"10.923") # Corresponds to +32767 in the above scale
        field(EGUL,"-10.923") # Corresponds to -32767 in the above scale
}
}}}

----

'''XT1541 DAC Channels:'''
{{{
record(ao,"C1:<CHANNEL_NAME>")
{
        field(DTYP,"asynInt32")
        field(OUT, "@asynMask(<PORT_NAME>, <X>, -16)MODBUS_DATA") # <X>: 0-7 physical channel on Acromag unit
        field(LINR,"LINEAR") # For count to float conversion: The ADC module converts +/-10V inputs to +/-30,000 counts (if legacy support is disabled, +/- 20,000 counts otherwise)
        field(EGUF,"10.923") # Corresponds to +32767 in the above scale
        field(EGUL,"-10.923") # Corresponds to -32767 in the above scale
}

'''XT1541 BIO Channels:'''
record(bo, "<CHANNEL_NAME>")
{
        field(DTYP,"asynInt32")
        field(OUT,"@asynMask(<PORT_NAME>, <X>, -16)MODBUS_DATA")
}
}}}

----

'''XT1111 & XT1121 BIO Channels:'''

For binary input:
''Not yet confirmed''

For binary output:
{{{
record(bo, "C1:<CHANNEL_NAME>")
Line 185: Line 260:
        field(OUT,"@asynMask(<DAC_UNIT_PORT_NAME>, 3, 0x1)")
}
}}}

===== XT1111 & 1121 =====

{{{
record( bo, "CHANNEL_NAME")
{
        field(DTYP,"asynUInt32Digital")
        field(OUT,"@asynMask(BIO0_Reg, 0, 0x1)")
}
}}}
        field(OUT,"@asynMask(<PORT_NAME>, <X>, 0x<Y>)") # <X>: 0-3 <Y>: 1,2,4,or 8
}
}}}

Slow Controls

Old Slow Controls Machines (Pre-2017)

Updated Mar 2019 Jon Richardson

Auxiliary DAQ Modules

The auxiliary DAQ system uses the Acromag XT series DIN-rail mounted ADC, DAC and BIO modules. The model numbers are in the format XTYYY1, where "XT" is a static prefix, "YYY" determines the function, and the "1" as the last digit denotes the ModBus/TCP version of the model. The 1 at the end is important, as the other variations will not be able to interface with CDS through EPICS.

Module

Function

# Channels

Notes

Manual

XT1111

BIO

16

Sinking outputs

Acromag_XT1111_manual.pdf

XT1121

BIO

16

Sourcing outputs

Acromag_XT1121_manual.pdf

XT1221

ADC

8

Differential inputs

Acromag_XT1221_manual.pdf

XT1541

DAC

8

4 sourcing output BIO channels

Acromag_XT1541_manual.pdf

HowTo

Configure auxiliary DAQ host machine

The following has proven to work with Debian Jessie (x64) on a Supermicro SYS-5017A-EP.

  • Fresh install of Debian Jessie (or most recent stable release)
    • Username: controls

    • Optional: lightweight desktop environment LXDE

  • Give sudo privileges to user controls

    su
    usermod -aG sudo controls
  • Set up SSH access
    • Run
      sudo apt-get install openssh-client
    • Add lines "search martian" and "nameserver 192.168.113.104" to /etc/resolv.conf

  • Set up martian and local ethernet adapters
    • Edit /etc/network/interfaces as follows:
      allow-hotplug eth0
      iface eth0 inet static
              address 192.168.113.XX
              netmask 255.255.255.0
              gateway 192.168.113.2
              dns-nameservers 192.168.113.104 131.215.125.1 131.215.139.100
              dns-search martian
      
      allow-hotplug eth1
      iface eth1 inet static
              address 192.168.11Y.1
              netmask 255.255.255.0
              network 192.168.11Y.0
              broadcast 192.168.11Y.255
    • XX is a placeholder for the machine's IP on the martian network
    • Y is placeholder for the IP root of the local subnet

      Hostname

      Martian IP

      Local IP

      C1SUSAUX

      192.168.113.???

      192.168.115.1

      C1AUXEX

      192.168.113.???

      192.168.114.1

      C1AUXEY

      192.168.113.???

      192.168.11?.1

      C1PSL

      192.168.113.???

      192.168.11?.1

      C1VAC

      192.168.113.???

      192.168.11?.1

      C1???

      192.168.113.???

      192.168.11?.1

  • Set up remote file system access
    • Run
      sudo apt-get install nfs-common
      mkdir /cvs/cds
    • Add line "chiara:/home/cds              /cvs/cds        nfs     rw,bg,nfsvers=3" to end of /etc/fstab and run

  • Install procserv for proper detaching of Modbus IOC systemd service
    sudo apt-get install procserv

Configure Acromag DAQ Modules

Initial configuration via USB is required before the units can be used on the network. This requires:

  • USB-to-miniUSB cable
  • Microsoft Windows (virtual) machine
  • Configuration Utilities: 9500465D.zip

The above zip file contains the setup executable to install the configuration software for all different modules. Depending on the module, a different version of the utility needs to be launched after install. As during operation, the to-be-configured device needs to be powered by a 12-32V DC voltage source, either through the designated blue plug-in terminal on the bottom, or the clip-on dock on the rail.

On a virtual machine it may be necessary to open some ports to allow the guest OS to access the physical USB device.

In USB Settings:

VirtualBox_USB_Settings.png

add a corresponding filter:

Acromag_USB_Description.png

The vendor ID and product ID can be found via lsusb

Network Configuration

The primary screen of the configuration utilities looks identical for all models:

xt1XX1_config_screen1.png

Once the device is connected to the host via USB and the correct application has been launched, it will appear in the drop down menu. On the right the device IP and other network parameters can be set. Every host machine of the auxiliary DAQ acts as a node between the martian network and a local subnet to which the Acromag modules belong and which is not directly accessible from other machines on the martian network.

  • For consistency, the ADC, DAC, and BIO modules occupy different IP address spaces:

    Module

    Local IP Address Space

    ADC

    20-39

    DAC

    40-59

    BIO

    60-79

  • Hostname and IP on the local network are assigned according to the following scheme:

    Hostname

    Local IP

    C1XXX-ADCYY

    192.168.11X.YY+20

    C1XXX-DACYY

    192.168.11X.YY+40

    C1XXX-BIOYY

    192.168.11X.YY+60

  • Other settings (of no practical significance) are
    • Gateway is the local IP of the node machine
    • DNS is that of Chiara on the martian network: 192.168.113.104

xt1221_config_screen2.png

xt1541_config_screen2.png

Configure XT unit Modbus driver

The EPICS binary modbusApp which launches the EPICS IOCs for the auxiliary DAQ system requires a .cmd instruction file which sets up the communication between the Acromag units and the EPICS IOC. The .cmd file is placed in /cvs/cds/caltech/target/HOSTNAME/HOSTNAME.cmd. It is largely similar to other EPICS binaries which launch an IOC, such as softIOC, with the addition that it can load the appropriate drivers for the modbus protocol prior to launching the IOC.

The file header consists of path definitions. At the current time there are no system variables pointing to these paths globally set, so the paths are explicitly defined.

epicsEnvSet("IOC", "c1XXX_iocconfig")   # insert proper hostname for XXX
epicsEnvSet("ARCH","linux-x86_64")
epicsEnvSet("TOP","/cvs/cds/rtapps/epics-3.14.12.2_long/modules/modbus")
epicsEnvSet("MDBTOP","/cvs/cds/rtapps/epics-3.14.12.2_long/modules/modbus")
dbLoadDatabase("$(MDBTOP)/dbd/modbus.dbd")
modbus_registerRecordDeviceDriver(pdbbase)

Each Acromag unit requires a set of three instructions which define the driver and Modbus parameters for the handshake during communication.

drvAsynIPPortConfigure(const char *portName,  # user-defined: used for subsequent referencing, 
                       const char *hostInfo,  # format: "IP-Address:Port". Standard port for Modbus is 502
                       unsigned int priority, # 
                       int noAutoConnect,     # 
                       int noProcessEos);     # 

modbusInterposeConfig(const char *portName,    # reference to portName created with drvAsynIPPortConfigure command
                      modbusLinkType linkType, # 
                      int timeoutMsec,         # define timeout for waiting for response from unit
                      int writeDelayMsec)      #

drvModbusAsynConfigure(portName,                # used by channel definitions in .db file to reference this unit)
                       tcpPortName,             # reference to portName created with drvAsynIPPortConfigure command
                       slaveAddress,            # 
                       modbusFunction,          # defines driver function for the unit (read register = 4, write register = 6, write single coil = 5) - see examples in next section
                       modbusStartAddress,      # ADC and binary channel numbering starts with 0, DAC channel numbering with 1
                       modbusLength,            # length in dataType units - see examples in next section
                       dataType,                # 4 = 16-bit signed integers (for A/D and D/A), 0 = binary (for BIO, duh)
                       pollMsec,                # how frequently to request a value in [ms]
                       plcType);                #

Examples

A generic example sequence would be

drvAsynIPPortConfigure("<TCP_PORT_NAME>","<UNIT_IP_ADDRESS>:502",0,0,1)
modbusInterposeConfig("<TCP_PORT_NAME>",0,5000,0)
drvModbusAsynConfigure("<PORT_NAME>","<TCP_PORT_NAME>",0,<modbusFunction>,<modbusStartAddress>,<modbusLength>,<dataType>,<pollMsec>,"Acromag")

Note that the default values for the last instruction differ between the different XT DAQ modules.

ADC Module XT1221:

drvAsynIPPortConfigure("c1susaux_adc00","192.168.115.20:502",0,0,1)
modbusInterposeConfig("c1susaux_adc00",0,5000,0)
drvModbusAsynConfigure("C1SUSAUX_ADC00","c1susaux_adc00",0,4,0,8,4,32,"Acromag")

DAC (+4x BIO) Module XT1541:

drvAsynIPPortConfigure("c1susaux_dac00","192.168.115.40:502",0,0,1)
modbusInterposeConfig("c1susaux_dac00",0,5000,0)
drvModbusAsynConfigure("C1SUSAUX_DAC00","c1susaux_dac00",0,6,1,8,4,1,"Acromag")
drvModbusAsynConfigure("C1SUSAUX_DAC00_BIO","c1susaux_dac00",0,5,0,4,0,1,"Acromag")   # Separate instruction for integrated BIO channels

BIO Modules XT1111 & XT1121:

drvAsynIPPortConfigure("c1susaux_bio00","192.168.115.60:502",0,0,1)
modbusInterposeConfig("c1susaux_bio00",0,5000,0)
drvModbusAsynConfigure("C1SUSAUX_BIO00","c1susaux_bio00",0,6,0,4,0,1,"Acromag")

After loading the drivers and setting up the modbus communication, the .cmd file instructs to load EPICS database files, just like other EPICS IOC starters. Like the .cmd file, the database files are located in /cvs/cds/caltech/target/HOSTNAME.

dbLoadDatabase("/cvs/cds/caltech/target/HOSTNAME/SUBSYSTEM.db")

Define EPICS channels

Note: Modbus/TCP is simply a protocol for sending commands via TCP that the XT units can interpret, as in read/write the correct register values to/from the channels. There may be multiple ways to define the channels have the same effect. The settings reported here have been found to work as intended.

The EPICS records in the .db files for the different DAQ channels are defined as follows (only fields relevant for proper addressing and conversion are shown):


XT1221 ADC Channels:

record(ai,"C1:<CHANNEL_NAME>")
{
        field(DTYP,"asynInt32")
        field(INP, "@asynMask(<PORT_NAME> <X> -16)MODBUS_DATA")   # <X>: 0-7 physical channel on Acromag unit
        field(LINR,"LINEAR")    # For count to float conversion: The ADC module converts +/-10V inputs to +/-30,000 counts (if legacy support is disabled, +/- 20,000 counts otherwise)
        field(EGUF,"10.923")    # Corresponds to +32767 in the above scale
        field(EGUL,"-10.923")   # Corresponds to -32767 in the above scale
}


XT1541 DAC Channels:

record(ao,"C1:<CHANNEL_NAME>")
{
        field(DTYP,"asynInt32")
        field(OUT, "@asynMask(<PORT_NAME>, <X>, -16)MODBUS_DATA")   # <X>: 0-7 physical channel on Acromag unit
        field(LINR,"LINEAR")    # For count to float conversion: The ADC module converts +/-10V inputs to +/-30,000 counts (if legacy support is disabled, +/- 20,000 counts otherwise)
        field(EGUF,"10.923")    # Corresponds to +32767 in the above scale
        field(EGUL,"-10.923")   # Corresponds to -32767 in the above scale
}

'''XT1541 BIO Channels:'''
record(bo, "<CHANNEL_NAME>")
{
        field(DTYP,"asynInt32")
        field(OUT,"@asynMask(<PORT_NAME>, <X>, -16)MODBUS_DATA")
}


XT1111 & XT1121 BIO Channels:

For binary input: Not yet confirmed

For binary output:

record(bo, "C1:<CHANNEL_NAME>")
{
        field(DTYP,"asynUInt32Digital")
        field(OUT,"@asynMask(<PORT_NAME>, <X>, 0x<Y>)")   # <X>: 0-3    <Y>: 1,2,4,or 8
}

CDS/SlowControls (last edited 2023-06-12 19:42:12 by AnchalguptaATligoDOTorg)