omron — DEVICES program instruction

DEVICES program instruction DEVICES program instruction Syntax DEVICES (type, unit, error, p1, p2, ... ) $out, $in Function Send a command or data to an external device and optionally return data. The actual operation performed depends on the device referenced. Usage Considerations The syntax contains optional parameters that may be useful only for specific device types and commands. Parameters type Real value, variable, or expression (interpreted as an integer) that indicates the type of device being referenced. The following types are currently available:

0 = Belt encoder 1 = (Not used) 2 = Force Processor Board (for Omron Adept use only) 3 = Robot device (i.e., servo, for Omron Adept use only) 4 = Vision 5 = 1394 bus (for Omron Adept use only) unit Real value that indicates the device unit number. The value must be in the range 0 to (max -1), where max is the maximum number of devices of the specified type. The value should be 0 if there is only one device of the given type. error Optional real variable that receives a standard system error number if this instruction failed. If this parameter is omitted, any device error stops program execution. If the error parameter is specified, the program must check it to detect errors.

The value is negative if there was an error. Otherwise, the positive value indicates the number of data bytes that were returned in the $in parameter. p1, p2, ... Optional real values that are sent to the device as part of a command. The number of values specified and the meanings of the values depend upon the particular device type. eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 175