4 module responses (mrsp), 1 status byte – Sensoray 2600 User Manual

Page 14

Advertising
background image

2600 Family Instruction Manual

9

Chapter 3 : IOM Gateway

Figure 10: MCmd Structure

3.4 Module Responses (MRsp)

A target module will produce one MRsp in response to every
received MCmd that is determined to be valid and error-free,
even if none of the actions in the corresponding MCmd
produce responses. If the received MCmd contains errors,
such as improperly formatted or unrecognized actions, the
target module will not transmit an MRsp.

Every MRsp begins with a three-byte header consisting of the
module identifier, response byte count and module status. A
variable-sized field, which follows the header, comprises a list
of zero or more action responses that were produced by the
module as a result of executing the associated MCmd.

MRsps may vary in length, depending on the number and
character of the action responses that are produced by the
source module. The total length of an MRsp, including its
header, may not exceed 254 bytes; this limit is imposed by the
MRsp format. Most IOM types limit the maximum MRsp size
to less than 254 bytes due to internal buffer size limitations.
Refer to the IOM model documentation to find the
specification for an the IOM’s maximum MRsp length.

Figure 11: MRsp Structure

If several actions are to be executed by an IOM, it is possible
that the total length of a single MRsp will exceed the maximum
length supported by the IOM. In such cases it is best to break
up the IOM’s MCmd into multiple MCmd’s and distribute the
actions among the MCmd’s so that none of the associated
MRsp’s will exceed the IOM’s maximum MRsp length.

3.4.1 Status Byte

A status byte is included in the header of every MRsp. This
byte contains boolean bit flags that indicate various conditions
on the source module that are in effect before any actions
execute.

With the exception of one bit, the format of the status byte is
standardized for all IOM types as well as the gateway itself.
The most-significant three flag bits are common to the gateway
and all IOMs, while all other bytes are available for custom use
by individual module types.

Field

Type

Function

ModID

BYTE

Target module identifier. This specifies
the module to which the MCmd is to be
directed. In the case of IOMs, ModID is
the MM’s IOM port number to which the
target module is attached, in the range
0x00

to 0x0F. To address the gateway,

use the value 0xFF. Any value other than
0x00-0x0F

and 0xFF is illegal.

MCmdLen

BYTE

Length of the MCmd, including the two
header bytes. Since MCmds are limited to
a maximum length of 254 bytes, MCmdLen
may have any value in the range 0x02 to
0xFE

.

ActList[]

BYTE

List of actions to be performed by the
target module. When the target module is
an IOM (vs. the gateway), the gateway
regards ActList[] to be a byte string
because the gateway has no knowledge of
the number or types of parameters required
by IOMs. See Section 3.2 for details.

ModID

MCmdLen

ActList[]

Header

Actions

Field

Type

Function

ModID

BYTE

Module identifier. ModID indicates the
module that produced the MRsp. In the
case of an IOM, ModID is simply the MM’s
IOM port number to which the module is
attached, in the range 0x00 to 0x0F. The
special value 0xFF indicates that the MM
gateway produced the MRsp. Any value
other than 0x00-0x0F or 0xFF is illegal.

MRspLen

BYTE

Length of the MRsp, including the three
header bytes. Since MRsps are limited to a
maximum length of 254 bytes, MRspLen
may have any value in the range 0x02 to
0xFE

.

Status

BYTE

Module status. See Section 3.4.1 for
details.

RspList[] BYTE

List of action responses produced by the
module. This list is treated as a byte string
by the gateway because the gateway has no
knowledge of the number or types of
response parameters produced by IOMs.
The number of bytes in RspList[]
depends on the actions executed; all actions
have a fixed response size.

ModID

MRspLen

RspList[]

Header

Action Responses

Status

Advertising