esrf

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

WAGOSER.MAC
See other macros in category: All
Description:
Documentation:
    DESCRIPTION
    Macro to handle a WAGO serial line module through the WAGO Device Server and the wagocore.mac macros. Therefore a call to wagosetup must have been done before using these macros. The serial line is identified by the logical name given in the Device Server resources to the WAGO module.



    EXAMPLE
    wagosetup wcid33a
    Declares the Wago I/O stations named wcid33a as being accessible through macro set.
    p wago_ser_par("sl","timeout")
    Print the timeout for the logical channel named \"sl\"
    p wago_ser_get("sl")
    Read a string from the serial line associated to logical channel named \"sl\"
    byte array dd[10]; array_op("fill",dd); p wago_ser_put("sl",dd)
    Send bytes over the the serial line.


Macros:
    wago_ser_put
    Usage: wago_ser_put (logname,s)
    Writes the string s to the serial device with logical name logname.
    wago_ser_put(logname,d [,cnt])
    Writes the byte data array d to the serial device with logical name logname. By default, the entire array will be sent. The optional third argument cnt can be used to specify the number of array elements to send.


    wago_ser_get
    Usage: wago_ser_get (logname)
    Reads and return a string from the serial channel with logical name logname. Returns as many characters as are already available in the receiving queue. Returns a null string if no characters become available within the timeout period set with wago_ser_par()

    wago_ser_par
    Usage: wago_ser_par (logname,"?")
    Return the document list of possible argins
    wago_ser_par(logname,"timeout" [,t])
    Returns or sets the read timeout for the channel logname The units are seconds
    wago_ser_par(logname,"flush")
    Empty serial receiving queue and returns the number of characters that were in the queue


Internal Macros:
    _wago_ser_checkto
    Usage: _wago_ser_checkto (logname)
    Initialize timeout for the channel logname

    _wago_ser_checkch
    Usage: _wago_ser_checkch (logname)
    Check if the logname has already configured with wagosetup

Filename: wagoser.mac
Author: MP BLISS (Original 7/09).
$Revision: 1.0 $ / $Date: 2009/08/03 13:16:55 $
Last mod.: 03/08/2009 15:16 by perez