5 format translation – Sensoray 2600 User Manual

Page 15

Advertising
background image

2600 Family Instruction Manual

10

Chapter 3 : IOM Gateway

Figure 12: Status Byte

RST

indicates whether the module has undergone a hardware

or software reset. The RST flag is automatically set in
response to a power-up reset or a watchdog reset or by
invoking a HardReset or SoftReset action. The RST
flag may be cleared by issuing a ResetFlags action.

CERR

indicates that the module detected an error in a received

ModCmd. This flag will be set in response to a bad checksum,
improper command length, unrecognized command opcode or
invalid command parameter. The CERR flag may be cleared
by issuing a ResetFlags action.

HRST

indicates that the module has undergone a hard reset.

The HRST flag is automatically set in response to a power-up
or watchdog reset or by invoking a HardReset action. The
HRST

may be cleared by issuing a ResetFlags action. This

bit is meaningful only on IOMs; the gateway always sets this
bit to zero.

The Ethernet client must never reset the HRST flag because
control of this flag is reserved for gateway-to-IOM link
control. Any attempts by the client to reset HRST may result in
unpredictable behavior.

IOM-specific bits are reserved for custom use by the various
IOM types. Each IOM type defines the meaning of these bits
as appropriate for the functions performed by the module.

Refer to the specific IOM documentation for a description of
the definitions of these bits. Unless otherwise stated in the
IOM documentation, any of the IOM-specific status bits may
be cleared by issuing a ResetFlags action.

3.5 Format Translation

IOMs employ message formats that differ slightly from those
used in the Ethernet client’s MCmds and MRsps. When
forwarding communications between the client and target
IOMs, the gateway transforms messages to accommodate these
format differences. There are two key format differences:

• IOMs utilize a checksum byte that is not required by the

client. The checksum byte is computed and added to
messages that are forwarded to IOMs, and stripped from
messages that are forwarded to the client.

• Ethernet clients utilize a target module identifier byte that

is not required by target IOMs. This byte is stripped from
messages that are forwarded to IOMs, and added to
messages that are forwarded to the client.

3.5.1 Checksum

All checksums are expressed as a one-byte values. The
checksum is computed as follows:

• Sum together all of the bytes that are to be included in the

checksum. All of the included bytes are treated as
unsigned integer values.

• Truncate the accumulated sum to its least significant byte.

• Compute the one’s complement of the byte; this is the

checksum value.

3.5.2 I/O Module Commands

Before forwarding an MCmd to its target module, the gateway
translates the MCmd into the format required by the target
module. The translated MCmd is called a ModCmd.

As shown in Figure 13, every ModCmd begins with a one-byte
header that contains the ModCmd’s byte count. A
variable-sized field, which follows the header, comprises a list
of actions that are to be performed by the target module. The
action list is copied from the MCmd to the ModCmd without
modification. A checksum byte is computed and appended to
the end of the action list.

Figure 13: ModCmd Structure

3.5.3 I/O Module Responses (ModRsp)

Each response message received from an IOM is called a
ModRsp. Before forwarding a received ModRsp to the
Ethernet client, the MM translates the ModRsp into a MRsp,
which is the format required by the client.

Every ModRsp begins with a two-byte header. The first
header byte, MRspLen, indicates the total length of the
ModRsp including the header bytes.

A variable-sized field, RspList[], comprises a list of
responses that were produced as result of executing the
associated ModCmd’s action list. The response list is copied
from the ModRsp to the MRsp without modification.

The checksum is computed and validated against the received
checksum at the end of the ModRsp, and the received
checksum byte is stripped from the MRsp.

7

RST

6

CERR

5

4

HRST

3

0

2

1

0

0

0

0

0

IOM-specific

Standard

Field

Type

Function

MCmdLen

BYTE

Length of the ModCmd, including the
header and checksum bytes.

ActList[]

BYTE

List of actions to be performed by the
target module.

ChkSum

BYTE

Checksum of all bytes preceding the
ChkSum, including the header byte.

MCmdLen

ChkSum

ActList[]

Advertising