esrf

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

DEEPDEVICE.MAC
See other macros in category: All
Description:
    DEEPDEVICE.MAC - Macros for operating deep devices though ethernet (serial line still to be implemented)
Documentation:
    OVERVIEW
    These macros simplify scommunication with a family of electronic modules that follows certain communication conventions defined in the Detyector & Electronics Group and adopted in a number of in-house developements at ESRF. This kind of modules are called deep devices in the following description.

    To use these macros, a name (a non-numeric string) must be first assigned to each isgdevice with deepdev_add() macro function.
    Once a isgdevice has been succesfully configured, commands and request can be sent to it by means of deepdev_comm() or deep_comm_ack() macros.
    Communication can be flushed by deepdev_flush().
    Other macros are deepdevice that shows a list of devices currently configured, and deepdebug that toggles a special debug mode.

    EXAMPLE
    deepdev_add(\"mydev\", 2, 0, 0)
    Configures the first device connected IP ... and assigns the name \"mydev\" to it.
    print deepdev_comm(\"mydev\", \"?APPNAME\")
    Sends the command \"?APPNAME\" to the device and prints the answer on the screen.
    deepdevice
    Displays a table with the currently configured devices.


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


Macros:
    deepdev_add
    Usage: deepdev_add (<name>, <comdev>, <type>, <id>)
    Checks for the presence of a deep device. If succesful the device gets configured and <name> is internally assigned to it.
    This macro must be invoked before any other access can be done to the device. The communication device <comdev> must be either a number (a serial interface in the config file), a string representing a ethernet device or an ESRF device name recognised as a Serial Line Device Server.
    The parameters <type> and <id> allow to identify a specific deep device when more than one are chained in the same physical communication interface. The value of <type> selects the meaning of the identifier <id> as follows:
  • <type>=0: <id> indicates the position of the deep device in the communication chain. The first position is 0.
  • <type>=1: <id> corresponds to the address of the device as returned by the ?ADDR command.
  • <type>=2: <id> indicates the name of the device as returned by the ?DEVNAME command.
  • <type>=3: <id> indicates the functional type of module as returned by the ?APPNAME command.

    deepdev_remove
    Usage: deepdev_remove (<name>)
    Removes a currently configured deep device from the internal list.

    deepdev_check
    Usage: deepdev_check (<name>, <type>, <id>)
    Checks if <name> is a valid deep device identified by the parameters <type> and <id>. Returns -1 if the device is not a registered device, 0 if it does not match the identification parameters and 1 otherwise. The meaning of <type> and <id> is the same that in the macro function deepdev_add().

    deepdev_comm_ack
    Usage: deepdev_comm_ack (<name>, <comm>, [<bindata>])
    Sends the command <comm> to the device identified by <name> with acknowledge request. If the command is sent succesfully, this macro function returns the constant DEEPDEV_OK. If and error happens in the device, DEEPDEV_ERRANSW is returned.
    If there is a communication error, this macro function returns the constant DEEPDEV_ERR.

    deepdev_comm
    Usage: deepdev_comm (<name>, <comm>, [<bindata>])
    Sends the command <comm> to the device identified by <name>. If there is any answer from the device it is returned. If there is no answer the macro function returns either DEEPDEV_OK (if the command was sent with no error), DEEPDEV_ERR in case of error ot DEEPDEV_ERRANSW.

    deepdev_flush
    Usage: deepdev_flush (<name>)


    deepdevice
    Usage: deepdevice
    Displays a table with the isgdevices currently configured

    deepdebug
    Usage: deepdebug
    Switches debug mode for communication with isgdevices

    deep
    Usage: deep [hostname]
    Launch interactive communication program in a separated xterm. Requires the "deep" shell command installed on the current machine.

Internal Macros:
    deepdev_scan
    Usage: deepdev_scan(comdev)


    deepdev__flush
    Usage: deepdev__flush(mode, comdev, prflag)


    deepdev_read_line
    Usage: deepdev_read_line(mode, comdev)


    deepdev__read_array
    Usage: deepdev__read_array(mode, dev, myarray)


    deepdev__read_binary
    Usage: deepdev__read_binary(mode, comdev, myarray)


    deepdev__read_ascii
    Usage: deepdev__read_ascii(mode, comdev, naked)


    deepdev__read
    Usage: deepdev__read(mode, comdev, naked, bindata)


    deepdev__print_binary_header
    Usage: deepdev__print_binary_header(header)


    deepdev__send_binary
    Usage: deepdev__send_binary(mode, comdev, bindata)


    deepdev__send_ascii
    Usage: deepdev__send_ascii(mode, comdev, comm)


    deepdev__send
    Usage: deepdev__send(mode, comdev, comm, myarray)


    deepdev_lowcomm
    Usage: deepdev_lowcomm(comm, mode, comdev, prefix, bindata)


    deepdev__commode
    Usage: deepdev__commode(comdev)


    DEEPDEBUG
    Usage: DEEPDEBUG


    deep_getfile
    Usage: deep_getfile(name, remote_file, local_file)


    deepdev_setdefault
    Usage: deepdev_setdefault (appname, devicename)


Filename: deepdevice.mac
Author: P.Fajardo, (Original 6/10). $Revision: 1.5 $ / $Date: 2020/02/26 16:17:50 $
Last mod.: 26/02/2020 17:18 by guilloud