esrf

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

HDH.MAC
See other macros in category: Positioning
Description:
    Macros to read the Heidenhain encoders (RON 806) through a serial line.
Documentation:
    DESCRIPTION
    Macros to define and control Haidenhein encoders as pseudomotors
    These hdh are assumed to be controlled through a serial line
    Through an Hdh, we can access 2 values.

    Serial line protocol:
    • ^B to ask for a value
    • The response of the serial line is :
      • X=`sign' <floating value> R <CR><LF>
      • Y=`sign' <floating value> R <CR><LF><LF><LF><LF><LF>
    NOTE: For the following macros, the HDH_DEV_index represents the index 0..n in the list of HDH devices defined by the user with hdhsetup If this parameter is omitted, as it is always the last parameter in the list of the macro, Spec will replace it by 0. So omitting it allows to work with the first HDH of the list.

    DEPENDENCIES
    To use an HDH encoder:
    • load the macro file : hdh.mac
    • setup the encoder(s) : with hdhsetup
    • configure your encoder(s) :
      • controller NONE
      • mnemonic corresponding to the one provided in hdhsetup


Macros:
    hdhsetup
    Usage: hdhsetup <nb> <dev_name1> <pseudo_mne1> <ch1> <nch1> <dev_name2> <ch2> <pseudo_mne2> ...
    setup of the devices :
    • nb : nb of hdh pseudomotors defined
    • dev_name`i' : Name of the MAXE device containing the CC133 encoder for the `i'th pseudom.
    • pseudo_mne`i': mnemonic associated to that pseudomotor
    • ch`i' : channel number (1 for X) or (2 for Y)
    • nch`i' : number of channels of the equipement
    when called without arguments, this macro asks interactively for the values
    This macro allows to define some HDH encoders as pseudomotors.
    For each encoder, the user has to provide the mnemonic for this encoder (free), the server device name for the hardware access to the encoder, an integer indicating which channel he wants to read, and the number of channels managed by the equipement. Each encoder has a number, from 0 to [nb]-1.
    In the following functions, HDH_DEV_index represents this number.

    hdh_flush
    Usage: hdh_flush <HDH_DEV_index>
    prints what is on the buffer for a device (flushes the serial line)

    hdh_read
    Usage: hdh_read <n> <HDH_DEV_index>
    reads a TWO channels equipement.
    reads the heidenhain channel value for the `HDH_DEV_index'th encoder, according to `n'.
    If n is not provided, prints the values of the 2 channels of a device
    If n is 1 : prints the value of X channel and puts it in HDH_VAL
    If n is 2 : prints the value of Y channel and puts it in HDH_VAL

    hdh1_read
    Usage: hdh1_read <n> <HDH_DEV_index>
    reads a ONE channel equipement.
    reads the heidenhain channel value for the `HDH_DEV_index'th.
    `n' is unused.
    Puts the value in HDH_VAL and prints it.

    hdh2_read
    Usage: hdh2_read <n> <HDH_DEV_index>
    reads a TWO channels equipement.
    reads the heidenhain channel value for the `HDH_DEV_index'th encoder, according to `n'.
    If n is not provided, prints the values of the 2 channels of a device
    If n is 1 : prints the value of X channel and puts it in HDH_VAL
    If n is 2 : prints the value of Y channel and puts it in HDH_VAL

    hdh3_read
    Usage: hdh3_read <n> <HDH_DEV_index>
    reads a THREE channels equipement.
    reads the heidenhain channel value for the `HDH_DEV_index'th encoder, according to `n'.
    If n is not provided, prints the values of the 2 channels of a device
    If n is 1 : prints the value of X channel and puts it in HDH_VAL
    If n is 2 : prints the value of Y channel and puts it in HDH_VAL

    hdh1_read3
    Usage: hdh1_read3 <motor_mne> <1/2> <HDH_DEV_index>
    macro for the pseudo_motor mecanism (ONE channel equipement)
    • motor_mne : motor mnemonic
    • 1/2 : unused
    • HDH_DEV_index : index in the devices list.


    hdh2_read3
    Usage: hdh2_read3 <motor_mne> <1/2> <HDH_DEV_index>
    macro for the pseudo_motor mecanism (TWO channel equipement)
    • motor_mne : motor mnemonic
    • 1/2 : 1 if X channel, 2 if Y channel.
    • HDH_DEV_index : index in the device list


    hdh3_read3
    Usage: hdh3_read3 <motor_mne> <1/2> <HDH_DEV_index>
    macro for the pseudo_motor mecanism (THREE channels equipement)
    • motor_mne : motor mnemonic
    • 1/2 : 1 if X channel, 2 if Y channel.
    • HDH_DEV_index : index in the device list


Internal Macros:
Filename: hdh.mac
Author: March 1st 1994 MCD
Last mod.: 25/04/2008 10:19 by rey