CTI 2572-B / 2500C-2572-B Installation and Operation Manual 95
Command Blocks
Command Blocks contain information which specifies how the command is to be executed. The standard
Command Block consists of 16 contiguous words located in the first 64k of PLC V memory and has the
following general structure.
Assuming the Command Block is valid, the module will write an error code into this location
when it encounters an error in executing the command. The error code can be used during
development as an aid to de-bugging logic. It may also be used by the PLC logic as an
indication to execute specific error processing logic.
Code
The Command Code is a number which uniquely defines the command you wish to execute.
Number
The connection number identifies the instance of the protocol manager with which you are
communicating. A connection number is similar to a file handle used in other operating
environments. The connection number is established when a CREATE CONNECTION or CREATE
SOCKET command is executed. During this process, a specific protocol manager is loaded and
associated with a particular physical port or a network socket. If the connection is created
using PLC logic, the programmer can assign a connection number. If the connection is
automatically created by the module, the module will assign a connection number.
The high byte of the Connection number should always contains hex 4B. The module uses
this byte as a Command Block "signature". The use of the signature byte provides a way for
the module to verify that the address you loaded in the command slot indeed points to a
valid command block and not some arbitrary area of V memory. When the module detects
that you have referenced an area of V memory where the high byte of offset 3 does not
contain hex 4B, it asserts the CMD Err and PLC Err. Since the module assumes that a block
without a signature byte is not a command block but a reference error, it does not attempt to
process the block of V memory and does not write any error information back into offset 0 of
the block.
Parameters
The command parameters provide command execution information. For example, for a Read
Command they may specify where to obtain the data, how many words to read, and where
to store the results. The number of command parameters required will vary with different