Rockwell Automation 2755-DM9, -DM9E High Speed Decoder User Manual

Page 94

Advertising
background image

Interface

Chapter 7
Host Commands Using the RS-232 or RS-422

7–2

ACK and NAK COMMANDS- If ACK/NAK communications protocol is
selected as part of the communications configuration of the decoder:

1) The host device must send an ACK after every bar code data message is
received correctly. If the message is not properly received, the host should
send a NAK to prompt a retry.

2) If a NAK is received by the decoder, the decoder will retransmit the last
message, up to three times. After the third NAK, the decoder will discard the
message.

Two Character Commands

The remainder of this chapter describes the two character commands that you
transmit to a decoder. Before we describe the commands, you should first
understand the format of the two character commands. Two character
commands have the following structure:

(1)

START

COMMAND

SEQUENCE

(2)

COMMAND

CODE

(3)

PARAMETERS

(4)

TERMINATOR

1) The start command sequence contains an escape sequence <ESC>=!
where <ESC> is ASCII decimal code 27. Refer to the following table.

Character

ASCII

Hex

ESC

27

1B

=

61

3D

!

33

21

Note: The start sequence is optional. The purpose of the <ESC>=! sequence
is to differentiate between two character and single character commands.
You must use the escape sequence if your single character commands use
one of the following characters:

C D H I M N O P R S.

If your single character commands do not use any of these characters, you do
not have to use the start command sequence.

2) The second part of the command is the command code.

3) The third part of the code contains the command parameters. Some
commands do not have parameters.

4) The fourth part of the command code is any ASCII control code (less than
decimal 32). The control code is used to terminate the command. Typical
control codes are: <CR>, <LF>, <CRLF>, or <ETX>.

Advertising