esrf

Beamline Instrument Software Support
SPEC Macro documentation: [ Macro Index | BCU Home ]

TEMPERATURE.MAC $Revision: 1.46 $
See other macros in category: All
Description:
    Macros for general temperature control.
Documentation:
    DESCRIPTION
    Those macros provide users with a common interface between SPEC and different type of temperature controllers.
    The temperature setpoint is driven as a (pseudo) motor, and other controller specific parameters can be set as (pseudo) counters.

    OVERVIEW
    Every standard ct / mv / and scan commands apply, plus the following ones defined by this set of macros :

    tcon / tcoff:
    enabling / disabling temperature controller devices one by one.
    rt:
    reports about all set up temperature controllers.
    tcramp:
    initiates a ramp into the controller.
    tclim:
    set temperature hardware limits.
    temperature_control:
    Setup command. see SETUP below.
    user_tc_io_1:
    User input for an action to be inserted just before addressing the hardware.
    user_tc_io_2:
    User input for an action to be inserted just after the device command is sent.
    user_tc_io_3:
    User input for an action to be inserted just after the device response is read.


    SETUP
    temperature_control (name,type,interface,address,sleept,channel,setuppars):
    It is the setup function for temperature controllers, that will associate each temperature setpoint to a motor. Basically, this function is called from setup file (one call per setpoint), and commented / uncommented along the user needs. After this command is executed for the first time, the device is by default enabled, unless it is unresponsive.
    Input parameters description:
    name:
    generic name for one temperature controller device, also used as motor mnemonic, to be put into SPEC config, controller NONE (pseudo motor), for controlling the setpoint. T_<name> can be set as a pseudo counter mnemonic to report the controlled temperature value in a counter as well.
    type:
    Supported controller types are "ILL","OX","HCC", "F700", "F26", "OXISO","ST15", "ST9700", "EURO","EURO900","LTC20", "LS200", "LS300" and "SIM". (more details later in the document (%{%<A HREF="#Specific"><B>"Devices Specific Issues"</B></A>%}%)).
    interface:
    Supported I/O interfaces are "GPIB", "RS232" and "RS232_1by1"; the last one stands for sending command characters one by one from SPEC, that considerably slows down the communication when it goes through the ethernet. It has proved to be sometimes necessary with the Oxford Instrument devices.
    address:
    the GPIB address or the Serial Line number relatively to SPEC config.
    sleept:
    slows down the communication flow. (in second#
    channel and setuppars
    are specific for each type of controller. They are described later; (%{%<A HREF="#Specific"><B>"Device Specific Issues"</B></A>%}%).
    Temperature limits:
    The setpoint software limits are taken out from the config corresponding motor limits. Hardware limits can be also set up in some controllers; use the command " tclim".
    Temperature polling:
    "DC_settle_time" and "DC_dead_band" config motors parameters are respectively used as temperature stabilization time in seconds and temperature bandwidth around setpoint in degrees. Default values are 0, what makes the move macros returns immediately after a change in setpoint. If they are set, the macro returns when the temperature has remain within the specified bandwidth at least the specified settling time. If only the "DC_settle_time" is set, the macros simply waits the specified amount of seconds, and if only the "DC_dead_band" is set, the macro waits for the temperature entering this bandwidth.
    %{%<A NAME="Specific"><B>Devices Specific Issues:</B></A>%}%
    "ILL": ILL Sample Environment Controller:
    Device specific temperature_control () parameters are not needed:
    • channel :0
    • setuppars:0. In fact this can be the OS9 prompt text, used internally for communication purposes only, but SPEC sets its own default if 0.
    ATTENTION: If several controller of that type are in use, they MUST all be configured with the same OS9 prompt.
    "OX": Oxford ITC 503:
    Device specific temperature_control () parameters:
    • channel : 1, 2 or 3, as sensor number that will be used for feedback.
    • setuppars: maximum output voltage value in Volts.
    Three additional pseudo-counters can be defined, following the naming convention T1<name> T2<name> and T3<name>, where <name> is the name given to temperature_control (). They corresponds to the 3 sensors temperatures handled by the Oxford ITC.
    _ox_checkres: is a macro that can eventually be hooked to user_tc_io_3 macro to perform Oxford ITC specific communication handcheck.
    oxstatus: is a macro that displays Oxford controllers specific parameters.
    ATTENTION: changing the setpoint will not work if the controller is running a sweep.
    "OXISO": Oxford ITC 503 IsoBus:
    Refer to "OX" part. Only the low level communication protocol changes, what is transparent to users.
    "HCC": Hubber CC41 Chiller Controller:
    • channel:0
    • setuppars:"intern" or "extern", referring to the temperature reference used for feedback. default is "intern".
    ATTENTION: If several controller of that type are in use, they MUST all be configured the same, either intern or extern.
    "F700": ASL Bridge:
    • channel:0
    • setuppars: double space separated list of 5 numbers, meaning:
      • 1st number is the Initial/Nominal Setpoint value in degrees.
      • 2nd number is the Gain, value 0, 1 or 2.(0=x1;1=x10 and 2=x100)
      • 3rd number is the Current, value 0, 2 to 5.(0=0.1mA;2=0.5mA;3=1mA;4=2mA and 5=5mA)
      • 4th number is the Bandwidth, value 0, 1 or 2.(0=1Hz;1=10Hz and 2=0.1Hz)
      • 5th number is a flag to say clear/reset (1) or not (0).
    ATTENTION: This type of controller does not provide a reliable way of reading back the temperature. The A[] array then holds the setpoint value rather than the current temperature.
    ATTENTION: For the time being, only one controller of that type can be setup in a same SPEC application.
    "F26": ASL Bridge:
    • channel:0
    • setuppars: double space separated list of 2 numbers, meaning:
      • 1st number is the Current, value 0 to 3.(0=0.1mA;1=0.3mA;2=1mA;3=3mA)
      • 2nd number is the Sensitivity, value 0,1,2 as low, med, high
    ATTENTION: For the time being, only one controller of that type can be setup in a same SPEC application.
    "EURO": EuroTherm 2000 series (also being tested for EURO900):
    • setuppars:"group:address" i.e "0:1". Many Eurotherm devices can be connected to the same serial line. Check the address in the device (usually 1).
    • Serial line must be configured as [1 start, 7 data, even parity, 1 stop]. For instance, in a solaris machine, if you want to use it from the workstation serial line just config the serial line as /dev/ttya raw evenp.
    • example: SPEC>temperature_control ("euro1","EURO","RS232",0,0,0,"0:1")
    • example: SPEC>temperature_control ("euro1","EURO900","RS232",0,0,0,"0:1")
    "LTC20": Conductus LTC-20
    • setuppars:"group:address" i.e "0:1".
    • example: SPEC>temperature_control ("ltc","LTC20","GPIB",0,0,0,"0:1")
    "LS200 & LS300": LakeShore 200 and 300 Series
    • setuppars:"group:address" i.e "0:1".
    • The controllers have been tested with type 218, 331, 340.
    • example: SPEC>temperature_control ("ex7","LS200","GPIB","0:5",0,1,"K", 1)
    • Possible channels are 1 to 8. The "K" is the unit to do the readings in: K Kelvin, C Celsius, S Sensor units.
    • example: SPEC>temperature_control ("ex8","LS300","GPIB","0:12",0,"B","K:1")
    • Possible channels A or B. The "K" is the unit to do the readings in: K Kelvin, C Celsius, S Sensor units.
    • Last value is the number of loop (":" separated from unit letter for LS300); the 300 series usually has two contrik loop outputs, which are used for the temperature setpoints.
    • Series 200 is read only.
    • On request of a user the usage of the heater of the series 300 is left to the user. The macros are LS300_heater_off and LS300_heater_setrange.
    "SIM": Simulation of temperature control.
    Only one at a time.
    Others devices can be added easily. see "%{% <A HREF="#INTERNALS">INTERNALS </A>%}%".


    DEPENDENCIES
    stlocal.mac and pseudo.mac have to be read in.

    ATTENTION
    Oxford Instrument:
    Changing the setpoint will not be possible if a sweep is running.
    Hubber CC:
    If several controller of that type are in use, they MUST all be configured the same, either intern or extern, concerning the temperature sensor in use for regulation.
    ILL:
    If several controller of that type are in use, they MUST all be configured with the same OS9 prompt.
    F700:
    The A[] array holds the setpoint value rather than the current temperature value which cannot be provided by the controller. For the time being, only one controller of that type can be setup in a same SPEC application.
    F26:
    For the time being, only one controller of that type can be setup in a same SPEC application.
    Available soon: tcramp and tcpid, respectively to program a ramp and to setup PID parameters.

    INTERNALS
    The entry points to add support for a new type of controller are temperature_control() function, _tc_hardware() function and a new _tc_ill() (or _tc_ox(), or _tc_hcc() ...) like command interface control function.
    temperature_control ():
    add new "type" key into local "supported_list" variable, delimited by percent character.
    _tc_hardware():
    add the call to the new command interface function, in the same way as for the already existing ones.
    _tc_newinterface():
    convert each typical and common action into specific instrument language protocol.


Macros:
    temperature_control
    Usage: temperature_control (name,type,interface,address,sleept,channel,setuppars)
    Setup macro. already explained into %{%<A HREF="#SETUP">SETUP paragraph</A>%}% above.

    temperature_remove
    Usage: temperature_remove (name)
    Has the same effect as commenting out the temperature_control() line in setup, i.e. remove all the control software associated with "name".

    tcon
    Usage: tcon <name>
    Turns On the specified device.

    tcoff
    Usage: tcoff <name>
    Turns Off the specified device.

    tcramp
    Usage: tcramp
    Not ready yet.

    tclim
    Usage: tclim <name> <min> <max>
    Set Hardware Temperature Limits. Software Limits are set independently as motor limits in config.
    Those hardware limits are checked by tcramp command that can be used out of the scope of temperature pseudo motors, because in that last case, no software limits are defined.

    rt
    Usage: rt
    Reports on all set up temperature controllers.

    oxstatus
    Usage: oxstatus <name>
    Oxford ITC types controllers status report.

    serialflush
    Usage: serialflush (num)
    Flushes out data from serial line.

    gpibflush
    Usage: gpibflush (address)
    clean up gpib communication.

Internal Macros:
    temperatureunsetup
    Usage: temperatureunsetup


    _tcon
    Usage: _tcon (name)
    Enabling sub-function.

    _tcoff
    Usage: _tcoff (name)
    Disabling sub-function.

    _tc_io
    Usage: _tc_io (interface,address,sleept,cmdstr,mode)
    Low level communication. mode=0 means do not read anything back, otherwise it should hold the terminator character/string.

    _tc_hardware
    Usage: _tc_hardware (action,value,type,interface,address,sleept,channel)
    Hardware interface. Convert generic action into hardware language.

    _tc_check_lim
    Usage: _tc_check_lim (name,min,max)
    Limit check for "tcramp".

    _tc_checkall
    Usage: _tc_checkall <motor_mne>
    user_checkall hook. Checks if temperature control device in question is enabled, otherwise exit.

    _tc_moveall
    Usage: _tc_moveall <motor_mne> <device_type> <interface> <address> [sleep_time]
    user_moveall hook. Changes the setpoint to the value requested by a move action.

    _tc_getpangles
    Usage: _tc_getpangles <motor_mne> <device_type> <interface> <address> [sleep_time]
    user_getpangles hook. Read and load into array A the current temperature value. (or the setpoint for F700 types controllers.)

    _oldtc_getpangles
    Usage: _oldtc_getpangles


    _tc_motorsrun
    Usage: _tc_motorsrun <motor_mne> <device_type> <interface> <address> <sleep_time>
    user_motorsrun hook. Returns 1 to say temperature setpoint reached in accordance with the config "DC_dead_band" and "DC_settle_time" parameters.

    _tc_check_dev
    Usage: _tc_check_dev (name)
    Returns the type of the controller if it has been correctly set up and if it is enabled, or -1 if not setup, or -2 if disabled.

    _tc_st15
    Usage: _tc_st15 (action,value)
    Scientific Instruments ST15 cryostat command interface.

    _tc_st9700
    Usage: _tc_st9700 (action,value)
    Scientific Instruments ST9700 cryostat command interface.

    _tc_hcc
    Usage: _tc_hcc (action,value)
    HUBBER CHILLER CONTROLLER CC41 Command Interface.

    _tc_ox
    Usage: _tc_ox (action,value,interface,address,sleept,channel)
    OXFORD INSTRUMENTS ITC503 Command Interface.

    _ox_decoderesp
    Usage: _ox_decoderesp(resp)


    _ox_checkres
    Usage: _ox_checkres
    eventually to be hooked to user_tc_io_3. Oxford ITC specific communication checking.

    _tc_oxiso
    Usage: _tc_oxiso (action,value,interface,address,sleept,channel)
    OXFORD INSTRUMENTS ITC503 Command Interface Using IsoBus protocol.

    _euro_calc_bcc
    Usage: _euro_calc_bcc (string)
    EuroTherm 2000 series checksum calculation.

    _euro_calc_bcc_stx
    Usage: _euro_calc_bcc_stx(_mystring)


    _euro_read
    Usage: _euro_read(address,channel, str)


    _euro_write
    Usage: _euro_write(address, type, channel, value)


    _euro_multiprg
    Usage: _euro_multiprg (address,channel)
    return true if EuroTherm 2000 support more than one prg

    _tc_euro
    Usage: _tc_euro (action,value,interface,address,sleept,channel)
    EuroTherm 2000 series command Interface.

    _tc_sim
    Usage: _tc_sim (action,value)
    SIMULATION of a temperature control command interface.

    _tc_ill
    Usage: _tc_ill (action,value)
    ILL SAMPLE ENVIRONMENT CONTROLLER Command interface.

    _tc_f700
    Usage: _tc_f700 (action,value)
    Automatic Systems Laboratories F700 command interface.

    _f700_ratio
    Usage: _f700_ratio (temperature)
    Converts temperature value into a ratio to feed the F700 controller.

    _tc_f26
    Usage: _tc_f26 (action,value)
    Alpha-Sigma-Lambda F26 temperature bridge control.

    _tc_ltc20
    Usage: _tc_ltc20 (action,value,interface,address,sleept,channel)
    Conductus LTC-20 command interface.

    _tc_ls200
    Usage: _tc_ls200 (action,value,interface,address,sleept,channel)
    LakeShore 200 series command interface.

    _tc_ls300
    Usage: _tc_ls300 (action,value,interface,address,sleept,channel)
    LakeShore 300 series command interface.

    LS300_heater_off
    Usage: LS300_heater_off motor_mnemonic
    LakeShore 300 series command interface.

    LS300_heater_setrange
    Usage: LS300_heater_setrange motor_mnemonic
    LakeShore 300 series command interface.

    __define__europrog
    Usage: __define__europrog()
    a function to define macros, if needed by temperature.mac, while eurotherm2400 isn`t loaded.

Filename: temperature.mac
Author: BLISS - ESRF . %{% <A HREF="mailto:lagier@esrf.fr"> Marie-Claire Lagier</A>%}%, May 2001 V.+1. Feel free to report any bug, comment or any other request. $Revision: 1.46 $, $Date: 2016/01/05 16:16:21 $
Last mod.: 05/01/2016 17:16 by guilloud