DEVICE program instruction DEVICE program instruction Syntax DEVICE (type, unit, error, p1, p2, ... ) out[i], in[j], out_trans, in_trans Function Send a command or data to an external device and, optionally, return data back to the program. (The actual operation performed depends on the device referenced.) Usage Considerations The syntax contains optional parameters that apply only to 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, variable, or expression (interpreted as an integer) 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 explicitly check it to detect errors. p1, p2, ... Optional real values, variables, or expressions, the values of which are sent to the device as part of the command. The number of parameters specified, and their meanings, depend upon the particular device type being accessed. eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 171