esrf

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

VPDU.MAC
See other macros in category: All
Description:
    ESRF Vme programmable delay unit.
Documentation:
    OVERVIEW
    vpdusetup
    command line setup
    vpdu
    menu setup and control
    vpdu_get*
    read in board settings
    vpdu_set*
    change board settings
    vpdutrig
    board trigger
    vpdureset
    board reset


    INTERNALS
    The following is a list of settings not from the VPDU device server, which are saved permanently:
    vpdu/number
    count of VPDU borads known to SPEC
    vpdu<n>/name
    device server resource name of board <n>
    vpdu<n>/MHz
    clock frequency if external clock of board <n>
    vpdu<n>/mnemonic/{1,2,3,4,5,6}
    (optional) SPEC software motor name for the delay of the short pulse output 1-6
    vpdu<n>/mnemonic/{t1,t2,t3}
    (optional) SPEC software motor name for the delay of the long pulse outputs T1-4, T2-3, T3-6
    vpdu<n>/mnemonic/{p1,p2,p3}
    (optional) SPEC software motor name for the pulse length of the long pulse outputs T1-4, T2-3, T3-6


    DEPENDENCIES
      - The file vpdu.mac has to be read in
      - it needs menu.mac.
    


Macros:
    vpdu_setup
    Usage: vpdu_setup
    Put this into your "setup" file. After a start fresh of SPEC is will redefine the hook macros for those VPDU channels which are defined as software motors.


    vpdu
    Usage: vpdu
    Menu to configure the VPDU board(s).
    VME PROGRAMMABLE DELAY UNIT SETUP
    
    
    - Device name <ID/SHUTTER/01> num 1.
    - Pulsed Width 300 mu-sec.
    - Channel 1 ON    delay 1 mu-sec.
    - Channel 2 ON    delay 2 mu-sec.
    - Channel 3 OFF 
    - Channel 4 ON    delay 4 mu-sec.
    - Channel 5 OFF 
    - Channel 6 OFF 
    - Trigger <external> on <rising> edge.
    - OR output OFF
    - Clock <internal> - Frequency 32 MHz
    
             RESET         TRIGGER 
    _________________________________
    Enter highlighted key or 0 to exit (0)? 
    
    - The board which device name appears here together with the generic number the software assigned to it is set as the active one. You can select other board by typing D.
    - Type any other highligthed letters to change any other parameters. - To change channel delay values, put the channel number in front of the "d" letter. (e.g. 3d).
    - RESET (RE) resets the board.
    - TRIGGER (TR) triggers the board once.
    - Internal clock cannot be set another rate that 32 MHz.



    vpdu_setpulse
    Usage: vpdu_setpulse <device_num> <micro_sec_pulse_width>
    Sets one board pulse width; the board is referenced to by the generic number the software has assigned it at setup (see vpdu or vpdusetup). %{%<A NAME="newsetchan"></A>%}%

    vpdu_setchannel
    Usage: vpdu_setchannel <device_num> <channel_num> <0|1>
    Enables (1) or disables (0) the specified channel on the specified board, referenced by the generic number the software has assigned it at setup (see vpdu or vpdusetup). %{%<A NAME="newsetdelay"></A>%}%

    vpdu_setdelay
    Usage: vpdu_setdelay <device_num(1,2,...)> <channel(1-6)> <micro_sec_delay>
    Writes to one board one channel delay; the board is referenced by the generic number the software has assigned it at setup (see vpdu or vpdusetup).

    vpdu_settrigger
    Usage: vpdu_settrigger <device_num> <"internal"|"external"|"automatic">
    Writes to one board the type of triggering to be used; the board is referenced by the generic number the software has assigned it at setup (see vpdu or vpdusetup).

    vpdu_setedge
    Usage: vpdu_setedge <device_num> <"falling"|"rising">
    Writes to one board which edge the external trigger would react on; the board is referenced by the generic number the software has assigned it at setup (see vpdu or vpdusetup).

    vpdu_setor
    Usage: vpdu_setor <device_num> <1|0>
    Writes to one board whether the OR output is activated or not; the board is referenced by the generic number the software has assigned it at setup (see vpdu or vpdusetup).

    vpdu_setmhz
    Usage: vpdu_setmhz <device_num> <mhz>
    Writes to one board the external clock frequency; if internal clock is used, the frequency is 32. the board is referenced by the generic number the software has assigned it at setup (see vpdu or vpdusetup).

    vpdu_setecl
    Usage: vpdu_setecl <device_num> <1|0>
    Writes to one board whether it should switch to internal clock if no ecl or not; the board is referenced by the generic number the software has assigned it at setup (see vpdu or vpdusetup).

    vpdu_setclock
    Usage: vpdu_setclock <device_num> <"none"|"internal"|"ttl"|"ecl">
    Writes to one board the of clock to be used; internal clock frequency is always 32 Mhz. the board is referenced by the generic number the software has assigned it at setup (see vpdu or vpdusetup).

    vpdutrig
    Usage: vpdutrig [device_num]
    Triggers once the active board, or the specified one, referenced by the generic number the software has assigned it at setup (see vpdu or vpdusetup).

    vpdureset
    Usage: vpdureset [device_num]
    Resets the active board, or the one specified (referenced by the generic number the software has assigned it at setup); 0 means all boards.

    vpdu_getpulse
    Usage: vpdu_getpulse <device_index>
    Reads in pulse width.

    vpdu_getdelay
    Usage: vpdu_getdelay <device_index> [channel_num]
    Reads in delay settings.

    vpdu_getchannel
    Usage: vpdu_getchannel <device_index> [channel_num]
    Reads in channel state.

    vpdu_gettrigger
    Usage: vpdu_gettrigger <device_index>
    Reads in trigger and edge settings.

    vpdu_getclock
    Usage: vpdu_getclock <device_index>
    Reads in OR output and clock settings settings.

    vpdu_getor
    Usage: vpdu_getor <device_index>
    Reads in OR output and clock settings settings.

    vpdusetup
    Usage: vpdusetup [[dev][pwdth][trig][edge][or][clk][frq][ecl]] [idem_2nd_board] ... OR [dev_board1] [dev_board2] [dev_board3] ...
    For "setup" file. Kept for compatibility with old version of the VPDU macros
    detail of the inputs:
    dev
    is the device server name.
    pwdth
    is the pulse width in micro-seconds.
    trig
    is the trigger type, i.e. either the string "automatic", or "internal", or "external". Any other string sets by default, the internal trigger.
    edge
    is "falling", or "rising", default being falling edge.
    or
    is the OR output line, set 1 or 0 depending wether you want it or not.
    clk
    is the clock signal, i.e. either the string "ecl", or "ttl", or "internal", or "none". Default is ecl clock.
    frq
    is the clock frequency, Mhz, always set to 32 in case of an internal clock.
    ecl
    is a flag 1 or 0, which determines wether the board should automatically switch setup to internal clock if no ECL is available.

    It is also possible to only give the list of device server names for all the board installed, and set the other parameters with the vpdu menu, or whatever mean. %MDESC%

Internal Macros:
    vpdu_menu_disp
    Usage: vpdu_menu_disp
    Vpdu menu display.

    vpdu_define
    Usage: vpdu_define %MDESC% Define hook macros for software motors


    _vpdu_menu_add_dev
    Usage: _vpdu_menu_add_dev <device_index>
    menu init macro when adding a new device.

    _vpdu_menu_rem_dev
    Usage: _vpdu_menu_rem_dev <device_index> <number_of_devices_prior_to_deletion>
    menu reset macro when deleting a device.

    vpdu_menu_setcor
    Usage: vpdu_menu_setcor <offset> <condit> <bitmsk> <resfix>
    menu macro to change CoR register automatically.

    vpdu_setCoR
    Usage: vpdu_setCoR <device_name> <cmd_offset_word> <set_word> <reset_word>
    Writes one board command register.

    vpdu_io
    Usage: vpdu_io <device_name> <command_string> [input] [output]
    Manages the I/O to the board.
    The value returned by esrf_io() is put into ESRF_RET global variable.

    vpdu_read
    Usage: vpdu_read
    Reads in active board settings.

    vpduchannel
    Usage: vpduchannel
    obsolete: use %{%<A HREF="#newsetchan">vpdu_setchannel</A>%}%.

    vpdusetdelay
    Usage: vpdusetdelay
    obsolete: use %{%<A HREF="#newsetdelay">vpdu_setdelay</A>%}%.

    vpdu_change
    Usage: vpdu_change
    called implicitly when you use do a "mv" or "scan" of a delay. Since the A[] array gives no information which motor is currently going to be moved, we have to guess it from the last recorded position values.

    vpdu_get
    Usage: vpdu_get
    called implicitly when you use do a "wa". (hook macro for "user_getpangles"). Reads back the current values from the device server for all those units and channels which have motor mnemonics and updates the corresponding entry in the motors array A[].

    set_value
    Usage: set_value (name,value)
    Useful to save values other than in global variables which would be lost after a "spec -f". The value is stored in an ASCII file under in the directory "~blissadm/local/spec/userconf/values". One unique file is created for each name given.

    value
    Usage: value (name)
    Returns a saved value from a previous "set_value" call.

Filename: vpdu.mac
Author: Marie-Claire LAGIER - 95/01/19
modified by MCL - 97/04/04
modified by ANDY GOTZ on request of FRIEDRICH SCHOTTE to use value and set_value macros to store the VPDU device number and names in $BLISSADM/local/spec/userconf. - 97/06/22
modified by Friedrich SCHOTTE - 97/06/24
Last mod.: 08/08/2002 18:43 by berruyer