esrf

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

MOCO.MAC
See other macros in category: Isg Other hardware
Description:
    MOCO.MAC - Macros for operating and testing the MoCo unit
Documentation:
    OVERVIEW
    This macro set allows to set MoCo isgdevices in spec, configure their analog outputs as a pseudomotors, their signal inputs as pseudocounters and provide simple macros for basic operation.
    An interactive macro moco can be used for device configuration and monitoring.
    More than one MoCo unit can be operated through this macro set.

    EXAMPLE
    mocosetup mocopiezo 2 inbeam=inb outbeam=outb
    Configures a MoCo unit connected to the serial line #2 and assigns the name \"mocopiezo\" to it . Associates the INBEAM and OUTBEAM input channels to the pseudocounters inb and outb.
    mocosetup pitch id33/serlin/11 scale=0.001
    Configures a MoCo unit associated to the TACO device \"id33/serlin/11\" and selects a scale factor of 0.001 for the pitch pseudomotor
    moco
    Starts the interactive test program with the default unit.
    mococonfig setpoint=0.9 sspeed=5
    Sets the regulation setpoint value to 90% and the scaning speed to 5 volts per second.
    mocotune pitch
    Starts a tuning procedure in the unit called \"pitch\". This unit becomes the default one.


    DEPENDENCIES
    These macros make use of the following macro sets:
    • stlist.mac
    • isgdevice.mac
    • isg.mac


    SETUP
    A mocosetup macro must be included in the setup file for every MoCo unit configured. Each unit is identified by its name that must be a unique isgdevice identifier.

Macros:
    mocosetup
    Usage: mocosetup <moco_name> <serline> [<parameter>=<value> ...]
    Configures a mocounit connected to <serline> with the name <moco_name>. If <moco_name> is also a valid motor mnemonic with no associated motor controller, it gets configured as pseudocounter driving the piezo output. The following optional parameters can be also set.
    • Valid parameters:
      address=<addr>
      This parameter allows to address a particular unit when the serial line is shared by several isgdevices in dasychain. If <addr> is a non-numerical value, it is treated as the isgdevice address set by the ADDR command and stored internally in the unit. On the other hand if <addr> is a numerical value it indicates the relative position of the module in the serial line chain starting from 0. If this parameter is not specified, spec looks for the first MoCo unit in the chain.
      scale=<scale_factor>
      Sets the scale factor for the piezo pseudomotor to <scale_factor>. The default is 1.
      rtime=<read_time>
      Sets the maximum update time in seconds for the piezo pseudomotor position. If set to 0, the piezo position is read from the unit at every \"wa\" or at every scan point. If set to -1, the unit position is read only when the pseudomotor is moved. The default is 10 seconds.
      outbeam=<cnt_mne>
      If <cnt_mne> is a valid counter mnemonic, it gets configured as OUTBEAM pseudocounter. The \"Scale Factor\" value in the spec config file applies.
      inbeam=<cnt_mne>
      If <cnt_mne> is a valid counter mnemonic, it gets configured as INBEAM pseudocounter. The \"Scale Factor\" value in the spec config file applies.
      foutbeam=<cnt_mne>
      If <cnt_mne> is a valid counter mnemonic, it gets configured as OUTBEAM filtered pseudocounter. The \"Scale Factor\" value in the spec config file applies.
      finbeam=<cnt_mne>
      If <cnt_mne> is a valid counter mnemonic, it gets configured as the INBEAM filtered pseudocounter. The \"Scale Factor\" value in the spec config file applies.
      sum=<cnt_mne>
      If <cnt_mne> is a valid counter mnemonic, it gets configured as a pseudocounter holding the sum of the INBEAM and OUTBEAM values. The \"Scale Factor\" value in the spec config file applies.
      fsum=<cnt_mne>
      If <cnt_mne> is a valid counter mnemonic, it gets configured as a pseudocounter holding the sum of the INBEAM and OUTBEAM filtered values. The \"Scale Factor\" value in the spec config file applies.
      diff=<cnt_mne>
      If <cnt_mne> is a valid counter mnemonic, it gets configured as a pseudocounter holding the difference of the INBEAM and OUTBEAM values. The \"Scale Factor\" value in the spec config file applies.
      fdiff=<cnt_mne>
      If <cnt_mne> is a valid counter mnemonic, it gets configured as a pseudocounter holding the difference of the filtered INBEAM and OUTBEAM values. The \"Scale Factor\" value in the spec config file applies.
      ratio=<cnt_mne>
      If <cnt_mne> is a valid counter mnemonic, it gets configured as a pseudocounter holding the ratio of the OUTBEAM and INBEAM values. The \"Scale Factor\" value in the spec config file applies.
      fratio=<cnt_mne>
      If <cnt_mne> is a valid counter mnemonic, it gets configured as a pseudocounter holding the ratio of the OUTBEAM and INBEAM filtered values. The \"Scale Factor\" value in the spec config file applies.
      cpiezo=<cnt_mne>
      If <cnt_mne> is a valid counter mnemonic, it gets configured as the pseudocounter holding the output voltage (?PIEZO). The \"Scale Factor\" value in the spec config file applies.
      oscmain=<cnt_mne>
      If <cnt_mne> is a valid counter mnemonic, it gets configured as the pseudocounter holding the main component used for regulation in oscillation mode. The \"Scale Factor\" value in the spec config file applies.
      oscquad=<cnt_mne>
      If <cnt_mne> is a valid counter mnemonic, it gets configured as the pseudocounter holding the quadrature component in oscillation mode. The \"Scale Factor\" value in the spec config file applies.
      softbeam=srcur
      Selects the value of the Storage Ring as software normalisation value.
      update=<update_time>
      Sets the update time in seconds for the interactive macro (moco). The default is 2 seconds.
      runforever[=yes]
      Runs the interactive macro (moco) in \"forever\" mode.


    mococonfig
    Usage: mococonfig [<moco_name>] [param=<value> ...]
    With no parameters displays some of the configuration values. With parameters the configuration values are changed.
    • Valid configuration values are:
      srange=<Vmin>:<Vmax>
      Defines the scan range for tuning.
      sspeed=<speed>
      Defines the scanning speed in volts per second.
      setpoint=<spoint>
      Sets the operation point
      set=<option>:<option>: ...
      Enables operation options
      clear=<option>:<option>: ...
      Disables operation options
      autotune=<autotune_event>:<autotune_event>: ...
      Enables autotune under certain conditions
      autotune=off
      Disables autotune
      autopeak=<autopeak_event>:<autopeak_event>: ...
      Enables autopeak under certain conditions
      autopeak=off
      Disables autopeak


    mocostate
    Usage: mocostate [<moco_name>]
    Prints the current state (Sends the request ?STATE to the MoCo unit).

    mocogo
    Usage: mocogo [<moco_name>]
    Starts regulation (Sends the command GO to the MoCo unit).

    mocostop
    Usage: mocostop [<moco_name>]
    Stops regulation (Sends the command STOP to the MoCo unit).

    mocotune
    Usage: mocotune [<moco_name> [S]]
    Performs a normal tunning procedure. If the parameter \"S\" is used the macro executes in silent mode and produces no screen printout.

    mocopeak
    Usage: mocopeak [<moco_name> [S]]
    Performs a peak tunning procedure. If the parameter \"S\" is used the macro executes in silent mode and produces no screen printout.

    moco
    Usage: moco [<device_name>]
    Macro that runs the interactive loop. moco refresh certain information on the screen and at the same time accepts commands from the standard input.


    mocoserver
    Usage: mocoserver


Internal Macros:
    _mocosetup
    Usage: _mocosetup(args)


    mocounsetup
    Usage: mocounsetup


    moco_setdefault
    Usage: moco_setdefault(isgname)


    moco__config
    Usage: moco__config(isgname, list)


    moco_wspaces
    Usage: moco_wspaces(str)


    moco__config_show
    Usage: moco__config_show(isgname)


    moco_comm
    Usage: moco_comm(comm, isgname)


    mococomm
    Usage: mococomm


    moco__tune
    Usage: moco__tune(silent)


    moco_moco2user
    Usage: moco_moco2user(piezo, mocopos, scale)


    moco_user2moco
    Usage: moco_user2moco(piezo, userpos, scale)


    moco_resetlimits
    Usage: moco_resetlimits(isgname, piezo, scale)


    moco_move
    Usage: moco_move(isgname, piezo, scale)


    moco_motorsrun
    Usage: moco_motorsrun


    moco_getpangles
    Usage: moco_getpangles(isgname, piezo, scale)


    moco_getstate
    Usage: moco_getstate(isgname, flag)


    moco_getcounts
    Usage: moco_getcounts(isgname, comm, _outbeam, _inbeam, _sum, _diff, _ndiff, _ratio)


    moco_getcountpiezo
    Usage: moco_getcountpiezo(isgname, _cpiezo)


    moco_getoscilcounts
    Usage: moco_getoscilcounts(isgname, _oscmain, _oscquad)


    moco_srcurrent
    Usage: moco_srcurrent (<isgname>)


    moco_update
    Usage: moco_update


    moco_prompt
    Usage: moco_prompt
    Displays the prompt on the screen. If the "update" flag is set also displays the board status.

    moco_show_comm
    Usage: moco_show_comm


    moco_process_comm
    Usage: moco_process_comm


    moco_cfg_show_cnt
    Usage: moco_cfg_show_cnt(mne)


Filename: moco.mac
Author: P.Fajardo, (Original 8/00). $Revision: 1.15 $ / $Date: 2016/12/02 10:25:41 $
Last mod.: 02/12/2016 11:25 by guilloud