esrf

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

ISG.MAC
See other macros in category: Tools Isg
Description:
    Utility macros for interactive communication with isgdevices.
Documentation:
    OVERVIEW
    This macro set provides utilities to build macros to talk interactively to isgdevices. Most of the internals are implemented by the macro function isg_main() that can be customised by redefinition of the macros isg_prompt, isg_update, isg_show and isg_process. In this way the functionality may be extended and adapted to specific features of certain isgdevices.
    The macro isg is an example of use of isg_main() and can be used as a generic interactive macro to dialogue with any isgdevice.

    EXAMPLE
    isg 0
    Starts the interactive test program to talk to the first isgdevice connected to the serial line port 0.
    isg isg/serlin109/6 type=VSCANNER
    Talks to the first isgdevice connected to the device isg/serlin109/6.

Macros:
    isg
    Usage: isg <device_name> [<parameter>=<value> ...}]
    Macro that runs the interactive loop. isg canrefresh certain information on the screen and at the same time accepts commands from the standard input. The following optional parameters can be also set.
    • Valid parameters:
      position=<pos>
      This parameter allows to address a particular unit when the serial line is shared by several isgdevices in dasychain. <pos> is a numerical value it indicates the relative position of the module in the serial line chain starting from 0.
      address=<addr>
      This parameter allows to address a particular unit when the serial line is shared by several isgdevices in dasychain. <addr> is is treated as the isgdevice address set by the ADDR command and stored internally in the unit.
      type=<type>
      This parameter allows to address a particular unit when the serial line is shared by several isgdevices in dasychain. <type> must be an uppercase string that identifies the functional type of isgdevice.
      isgname=<name>
      This is the private name used by spec to identify the device. If not set, the name is forced to %"isg%".
    If no addressing parameter is specified, spec looks for the first unit in the chain.

    isg_main
    Usage: isg_main (<isgdev> [, <options> [, <minT>, <maxT>]])
    This macro function runs a loop to provide interactive communication to an isgdevice. Among the available features :
  • Checks for keyboard input and compares with the list commands recognised by the isgdevice. If the command is recognised by the device then it sends it through the serial line. If not, the macro tries execution by the eval() function.
  • Can update information on the screen, like the status of the device.
  • Whith the option 'S' implements a TCP server for isgdevices.
  • Implements special commands (starting by a dot character \".\" )
  • It can be customised by macro redefinition.

Internal Macros:
    _isginit
    Usage: _isginit(args)


    isgserver
    Usage: isgserver


    _isg_prompt
    Usage: _isg_prompt


    _isg_update
    Usage: _isg_update


    _isg_show
    Usage: _isg_show


    _isg_process
    Usage: _isg_process


    isg___command
    Usage: isg___command(isgname, line)


    isg_check_devcomm
    Usage: isg_check_devcomm(devcomm, line, commlist)


    isg___prompt
    Usage: isg___prompt
    Prints the user prompt.

    isg___process
    Usage: isg___process(isgname, line, commlist)
    Macro function that analyzes and execute special commands It returns '0' if it is not an internal command, '1' if the command is recognized and `-1' if it is not.

    isg_show_comm
    Usage: isg_show_comm(comm, descr)


    isg_show_commlist
    Usage: isg_show_commlist(commlist)


    isg_get_commands
    Usage: isg_get_commands(isgname, commlist)


    runonce
    Usage: runonce(macro, key)


    runonce_cleanup
    Usage: runonce_cleanup


    runforever
    Usage: runforever(macro)


    stopforever
    Usage: stopforever()


    isg_save
    Usage: isg_save(isgname, info, fext)


    isg_path
    Usage: isg_path(lpath)


    isg_upload
    Usage: isg_upload(isgname, file, fext)


    __tocase
    Usage: __tocase(str, case)


    isg_ls
    Usage: isg_ls(isgname, path, fext)


    isg_file_header
    Usage: isg_file_header(filepath, finfo, verbose)


Filename: isg.mac
Author: P.Fajardo, Revision: 8/00, (Original 8/00). $Revision: 1.8 $ / $Date: 2019/11/20 15:40:35 $
Last mod.: 20/11/2019 16:42 by homsrego