esrf

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

MAXEENC.MAC
See other macros in category: Positioning
Description:
    Using encoder readings from a maxe server as pseudo counters
Documentation:
    DESCRIPTION
    Encoders which are configured can be used as counters. This allows you to do scans to measure encoder ratio ( specially useful if it is not linear). The encoder readings will also be written to the scanfile to allow off-line analysis.
    . The encoder will be read during counting and the result will be the average of all these readings. You have to define a counter with controller set to NONE and call encsetup . If you do not want to use the encoder pseudo counter any more, just delete it with specs configuration editor.

    EXAMPLE
    encsetup inch "ID18/spec_maxe/1" 1
    This sets up the inch pseudo counter to read from Maxe device ID18/spec_maxe/1 , channel 1. This is usually be done in the idxxxsetup.mac


    SETUP
    The resource files of the Maxe server have to be configured for encoders.

    ATTENTION
    • There is no delete macro for the moment
    • Reading is done for each encoder separately. These macros have not been written with fast execution speed in mind and should therefore only be used during testing.


    DEPENDENCIES
    The file maxeenc.mac has to be read in !done by: startup script (this file needs: cpseudo.mac stchanges.mac)

Macros:
    encsetup
    Usage: encsetup [counter-mne device channel] [counter-mne device channel] ...
    This macro defines the pseudo counters. The counter will read the encoder value from mxe device <device> channel <channel>.

    encset
    Usage: encset counter-mne value
    Resets the (incremental) encoder counted in counter-mne to value. Similar to set\ motor-mne\ value.

    encteston
    Usage: encteston [enc-mne sigma-mne first-mne last-mne]
    Switches on test mode where not only the average value for an encoder reading is calculated but also the sigma. (sigma = sqrt(sum(y-avarage)**2/ N)). sigma should not depend on the number of readings. The encoder mne specifies the encoder for which the sigma calculation has to be done. The sigma-mne is pseudo counter where the result has to be written to. (Can be empty - in this case there will be no sigma calculation but the values will still be stored in the ENC_TESTGRP

    enctestoff
    Usage: enctestoff
    Switches off test mode

Internal Macros:
    encon
    Usage: encon


    encoff
    Usage: encoff


    encunsetup
    Usage: encunsetup


    encbody
    Usage: encbody(how)


    enc_precount
    Usage: enc_precount <counter-mne> <device> <channel>
    Resets internal registers

    enc_getcounts
    Usage: enc_getcounts <counter-mne> <device> <channel>
    The actual reading routine

Filename: maxeenc.mac
Author: MAXEENC.MAC - JK 3.94
Last mod.: 12/08/2008 15:27 by rey