esrf

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

cyber.mac
See other macros in category: Detection Other hardware
Description:
    Macros to work with the Cyberstar boxes - SCA (Ampli, HV)
Documentation:
    DESCRIPTION
    This macro set offers basic commands for the cyberstar modules. The parameters on the standard SCA unit type and the Electrometer (not yet!) type can be read and set. For the SCA, the window between the lower and upper threshold can be scanned. Multiple SCA units can be defined, each containing one or more channels.

    OVERVIEW
    • The easiest way to inspect and change the cyberstar parameters is done with cybermenu.
    • The parameter can be changed individually with the following macros: cyberhv, cyberlow, cyberup, cybergain, cyberpeak
    • A simple scan of the SCA window can be done with : cyberscan
    • The more complicated things like doing a more complicated scan, getting intergated counts, doing peak search are done with the concept of pseudo motors. (Setup of this options should be done by experienced users or your spec administrator)


    EXAMPLE
    cybernewsetup 3 cyb
    This prepares the setup of 3 units (to be configured with cyberunitsetup) and defines the pseudomotor cyb to control the lower threshold of those units.
    cyberunitsetup 1 0 1 3 2 4 10 5 0.2
    This defines the second cyberstar unit as an SCA (type 0) model PPU5CH (model 1), configured with address 3, on SPECs serial device 2 with 4 seconds timeout. The unit has 5 channels, from 10 to 14. The default window size for scanning is 0.1 V. This means that scans on the motor cyb will scan the lower threshold and adjust the upper threshold to give a window of 0.1 V.
    cybersetup
    This macro is kept for compatibility. Use cybernewsetup and cyberunitsetup for more flexible setups
    cybermenu will give you the following screen:
    595.SPEC> cybermenu
    Settings on Cyberstar unit 0:
     0 ::               High Voltage [V] : 400.000
     1 ::         Lower SCA Threshold[V] : 0.600
     2 ::         Upper SCA Threshold[V] : 10
     3 ::                 Input Gain [%] : 40.000
     4 ::             Peaking Time [ns]  : 500.000
     5 ::            Remote Forced [0/1] : 0
    Enter number of parameter to change or -1 to exit (-1)? 1
    Set Lower SCA Threshold[V] on unit 0  (0.6)? .5
    


    SETUP
    • The serial line used by the cyberstar has to be set up in config
    • A motor has to be defined in config to be used as the lower threshold in window scans.


    INTERNALS


    DEPENDENCIES
    The file cyber.mac has to be read in !done by: startup script This file needs pseudo.mac and stchanges.mac

Macros:
    cybersetup
    Usage: cybersetup [<no of cyberstars>] [<serial line of first cyberstar>] [<default window size[V]>] [<default unit>] [<mne1> <mne2> ...]
    Old setup macro that assumes all units have a single channel, do not accept addresses and use serial lines configured consecutive in Spec. Sets up the serial lines to be used for the cyberstar units on the beamline. This macro must always be called first.

    cybernewsetup
    Usage: cybernewsetup [nrunits] [mne1] [mne2] ...
    This is the new setup macro for the Cyberstar. It does nothing but set the total number of units and define the pseudo motors to be used. If only one mne is specified, it will work with the active channel when the motor is moved, so cybersetchannel must be called first. All the "important" information about the hardware is set by calling cyberunitsetup for every unit in the system.

    cyberunitsetup
    Usage: cyberunitsetup [unit] [type] [model] [addr] [serline] [timeout] [startchan] [nrchan] [win]
    Initializes the specified unit. Each Cyberstart unit is of a particular type (SCA, etc...), and each type has different models. The addr parameter specifies the address configured by switches in the box; it must be -1 if the unit does not recongize addresses (very old ones). If multiple units are daisy chained, they must have the same serial line serline and different addresses. Channels are unique in the system, and for the given unit they start from startchan; nrchan says the number of channels in the unit. win is the default window size

    cybermenu
    Usage: cybermenu [channel]
    The cyberstar parameters can be entered in a menu. Enter the value printed in front of the parameter and you will be prompted . If no channel is given, the default channel is used.

    cyberscan
    Usage: cyberscan <start> <finish> <intervals> <time> [window]
    Scans the lower and upper threshold of the default cyberstar module. The scans starts at a lower threshold of <start> and scans in <interval> number of scan points to <finish>. The count time at every scan point is <time>. An optional parameter [window] can be given to modify at the same time the window between lower and upper threshold. All values are given in V. Be careful when setting <start> and <finish> as finish + window must be an allowed value for the upper threshold.

    cyberdelete
    Usage: cyberdelete
    Switches off the use of cyberstar pseudo motors and deletes the macros from user_xxxx

    cyberoff
    Usage: cyberoff
    Switches off the use of cyberstar pseudo motors

    cyberon
    Usage: cyberon
    Switches on the use of cyberstar pseudo motors

    cyberwindow
    Usage: cyberwindow [window] [channel]
    The scan window can be set faster with this macro than with the cybersetup macro

    cybersetunit
    Usage: cybersetunit [unit]
    Sets the default unit (actually channel) to use when no unit is specified in commands like set HV. Kept for compatibility, use cybersetchannel

    cybersetchannel
    Usage: cybersetchannel [channel]
    Sets the default channel to use in voltage threshold scans or another setting macro when the channel is not specified

    cyberstate
    Usage: cyberstate [channel]
    Prints the actual values of a cyberstar channel on the screen. If no channel is given, the default is used

    cyberhv
    Usage: cyberhv [HV in Volt] [channel]
    Sets the HV on channel channel or the default channel set by cybersetchannel

    cyberlow
    Usage: cyberlow [low threshold on SCA] [channel]
    Sets the lower threshold on <channel> or the default channel set by cybersetchannel

    cyberup
    Usage: cyberup [upper threshold on SCA] [channel]
    Sets the upper threshold on <channel> or the default channel set by cybersetchannel

    cybergain
    Usage: cybergain [input gain] [channel]
    Sets the input gain on <channel> or the default channel set by cybersetchannel

    cyberpeak
    Usage: cyberpeak [peaking time] [channel]
    Sets the peaking time in ns on <channel> or the default channel set by cybersetchannel

    cyberremote
    Usage: cyberremote [force remote flag] [channel]
    Sets the force-remote flag on <channel> or the default channel set by cybersetchannel

    cyberreset
    Usage: cyberreset [unit]
    Resets the Cyberstar unit. Not implemented

Internal Macros:
    cyber_init
    Usage: cyber_init %MEDESC% Initialises the global data for Cyberstars


    cyber_typeoffset
    Usage: cyber_typeoffset (type)
    Returns the offset to add to the model or parameter index depending of the unit type

    cyber_duplicate
    Usage: cyber_duplicate (type, base, new, name)
    Creates a new model new with name name as a duplicate of model base

    cyber_attr
    Usage: cyber_attr (chan, attr)
    Returns the channel/unit/model/type attribute of the specified channel

    cyber_support
    Usage: cyber_support (chan, par)
    Returns if parameter is supported by the channel/unit

    cyber_chan
    Usage: cyber_chan (parpos, par)
    Returns the channel with index chanparidx in pars, or CYBERCHAN if not specified

    cyber_string
    Usage: cyber_string (chan, par)
    Returns the correct string to send to the Cyberstar depending on the unit model and address

    cyber_serline
    Usage: cyber_serline (chan)
    Returns the serial line of the given channel

    cyber_check
    Usage: cyber_check (chan, par, val, rd)
    Check if the parameter is valid for the channel and translate it, if necessary, depending if it will be written (rd=0) or read (rd=1)

    cyber_chan_unit
    Usage: cyber_chan_unit (chan, nrunit)
    Returns the unit that holds the specified channel. If nrunit is greater than 0, specifies the nr. of units to search. Returns -1 if not found

    cyber_getangles
    Usage: cyber_getangles motor [channel]
    Read the lower threshold and puts the value in the pseudo motor

    cyber_moveall
    Usage: cyber_moveall motor [channel]
    Used to set the lower and upper threshold

    cyber_set
    Usage: cyber_set <function-id> [value to set] [channel]
    Set the specified value in the channel

    cyber_get
    Usage: cyber_get (chan, par)
    Reads and returns the specified parameter par of chan

    cyber_readf
    Usage: cyber_readf <channel> <id-string-variable> <value>
    Sends the specified string to channel and stores the box response in value as a float

    cyber_reads
    Usage: cyber_reads <channel> <id-string-variable> <value>
    Sends the specified string to channel and stores the box response in value as a string

    cyber_writev
    Usage: cyber_writev <channel> <id-string-variable> <value>
    Sets the parameter with <id-string> on <channel> to <value>

    cyber_accept
    Usage: cyber_accept <channel>
    Read a binary 6 and will print an error message and exit in case of a timeout

    cyberbody
    Usage: cyberbody(mode)


Filename: cyber.mac
Author: Jorg Klora , 2.95 $Revision: 3.7 $
modified June 3, 1997 - AS cybersetup does NOT switch on the cyber counter
Last mod.: 15/05/2012 11:37 by claustre