PLC
9836 3521 01 247
5.3.9 Device commands
Using the device command input and outputs it is possible to control individual devices directly from the
PLC.
Outputs:
The command to send to the device pointed out by
DEVCMD_DEVNAME. See table below for supported
commands.
The command is sent to the device when DEVCMD_CMD
changes to a non zero value.
The name of the device, as defined in the ToolsTalk
PowerMACS, to send the command to. For example, "Printer
01".
Size, in number of bytes, of additional command parameters
specified using DEVCMD_CMDPARDATA[].
Note! Only specific commands make use of addition command
parameters.
Additional command parameter data. Layout and usage
depends on the targeted device and command. See table
below for specification.
Currently only devices of type "Printer" are supported. For it the following command is available:
Prints DEVCMD_CMDPARSIZE bytes of the data supplied in the
DEVCMD_CMDPARDATA area.
The data is assumed to be binary and is printed without any additional formatting.
That is, to print the string "ABC" the following decimal data should be set as
parameters:
DEVCMD_CMDPARDATA[1] := 65
DEVCMD_CMDPARDATA[2] := 66
DEVCMD_CMDPARDATA[3] := 67
and DEVCMD_CMDPARSIZE := 3.
Illegal device types as targets and/or command codes are logged using events.
Note! Support for other device types and command codes may be added in future versions. To avoid
unexpected behavior when upgrading you should not make use of any other codes then the above
listed and zero (0).