Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeEnglishEspañolContact

The text of a manual · part 11 of 25

AI1620 SmartPass System Guide, pages 101 to 110

Pages 101 to 110 of 246

The original document is the PDF (4.1 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

For the Intermec AI1620 and Intermec SmartPass Reader AI1620

Page 101

Communication Protocols

6

This chapter describes the communication protocols for SmartPass.

Introduction SmartPass supports the following communication protocols:

•

Basic

•

Error correcting

•

Data inquiry

The following protocol information provides reference information relevant to developing host software. A two-way message interchange is required in both data mode and command mode when using error correcting protocol (ECP). This interchange is completed by the message recipient returning a message to the sender. With ECP, all transmissions require a message. If a message is not received, the sender will time out with the same effect as if it had received a negative acknowledgment (from the host) or an Error message (from SmartPass). XON/XOFF flow control is optionally supported. Be careful in the use of XON/XOFF because noise-induced characters may be interpreted by SmartPass as the XOFF character, which would suspend reader output without the host computer’s knowledge. Note: Amtech recommends that XON/XOFF flow control be disabled while using ECP. Communications are performed using the 7-bit ASCII code with optional parity, thus providing easy setup, testing, and diagnostics with standard ASCII terminals and serial printers. Parity must be enabled to achieve the specified undetected error rate. Each message is framed with the start-of-message (som) and end-of-message (eom) characters so that the host computer can detect the beginning and end of each message. This convention is most important under marginal communications conditions during which the host may receive extraneous noise-induced characters between reader transmissions. In such instances, the host is able to ignore any messages that do not conform to the som...eom frame sequence.

Basic Protocol With basic protocol, messages sent from SmartPass to the host are transmitted without error checking. Messages sent from the host to SmartPass are also transmitted without error checking. A Done or Error message is returned to the host by SmartPass for each host transmission.

6-3

Page 102

AI1620 SmartPass System Guide

When the host computer is physically close to SmartPass and no sources of interference exist, the basic protocol provides reliable communications. The host must be ready to receive reader-transmitted messages, because in basic protocol SmartPass does not wait for the host to acknowledge a message before transmitting the next message. If necessary, the host may halt reader transmissions by using software or hardware flow control. Refer to Chapter 6, “General Software Information,” for flow control information.

Error Correcting Protocol Wherever the quality of data communications is imperative or may be suspect, ECP can be invoked to ensure the integrity of data transmitted between SmartPass and the host. Note: Amtech recommends that basic protocol (not ECP) be used when commands are entered manually at the keyboard. Error correction is accomplished with use of a cyclic redundancy check (CRC) value that is based on the message data. The originator (reader or host) calculates the CRC of a message and includes it in the transmitted message. The recipient (reader or host) also calculates a CRC for the received message. If the transmitted message data is correct, the CRC calculated by the recipient will agree with the CRC calculated by the originator. If the CRCs do not agree, the message is rejected. Message sequence numbers are also included when using the ECP. These sequence numbers are checked to determine if the message received has the correct sequence number; if not, the message is rejected. Since the 7-bit ASCII code is used and there are 8 data bits per character, the eighth bit can optionally be used to support parity. Where parity is selected, the CRC calculation includes the parity of each character in the calculation of the CRC value. Parity is required to achieve the most reliable communications. If parity is enabled, both SmartPass and host must issue a message if any received character has a parity error. However, the message must not be transmitted before receipt of the eom character. SmartPass will issue an Error message and the host a negative acknowledgment message.

Data Inquiry Protocol Data inquiry protocol is a basic protocol option that allows the host to control transmission of reader tag data. The selection of data inquiry protocol affects data mode operation. As SmartPass acquires tags, it buffers them but does not transmit them. Instead, the host must poll SmartPass for each tag by sending a CTRL-E

6-4

Page 103

Communication Protocols

6 character (hex 5 digits). SmartPass transmits one message (tag ID or report data) for each CTRL-E it receives until the buffer is empty. Each tag request message sent by the host consists only of the CTRL-E character; no som or eom characters are sent. SmartPass data transmission (tag ID and report data) format is the same as for basic protocol. Selection of data inquiry protocol does not affect command mode operation.

Basic and ECP Protocol Format Note: In the following text, the symbols < and > are used to represent required variable message data, and the symbols [ and ] are used to represent optional data. These symbols are not part of the message syntax.

Reader Transmissions The basic protocol format and the data inquiry protocol format are shown below.

<som><data><eom> The ECP format is shown below. <som><seq><data><crc><eom> where:

<som>

Start-of-message (ASCII # character)

<seq>

Sequence number (ASCII hex) that represents an even number in the range 0–9, A–E (0, 2, 4, 6, 8, A, C, E). This number is maintained by SmartPass. The host must acknowledge reader transmissions by sending an ACK message with the same sequence number received from SmartPass. SmartPass will update its sequence number upon receipt of a valid host ACK. If an ACK is not received, SmartPass will retransmit the message. A reader transmission sequence is not considered compete until SmartPass receives an ACK and updates its sequence number.

<data>

An ASCII string up to 72 characters long. This string may contain tag data, a presence without tag report, an input status change report, an Error02, 03, 04, or 05 message (buffer level report), or a sign-on message. Time, date, and auxiliary data may also be included.

<crc>

Cyclic redundancy check (CRC). This field contains four ASCII digits that represent the 16-bit CRC calculated on the message. The CRC is calculated on bytes between the som character and the first CRC byte. When the host receives a properly framed message, it can calculate a 16-bit CRC. The calculation is applied to the character

6-5

Page 104

AI1620 SmartPass System Guide string that immediately follows the <som> and that ends with the character immediately preceding the first <crc> character. The transmitted CRC can then be compared with the binary equivalent of the received <crc> characters. If the transmitted and received CRCs are not the same, the message is assumed to have been received in error, and a NAK message response should be transmitted. <eom>

End-of-message characters (ASCII CR and LF). Both a carriage return (CR) and line feed (LF) are included to facilitate the use of terminals and printers. If the host receives a <som> character in the middle of a data message, the message in progress must be aborted. The assumption is that an <eom> was lost and SmartPass is in the process of retransmitting the previous message.

ECP Host ACK/NAK Response With ECP, the host computer responds to all data message transmissions from SmartPass using the following acknowledgment or negative acknowledgment response format.

<som><seq><ack/nak><crc><eom> where:

<som>

Start-of-message (ASCII # character)

<seq>

An echo of the sequence number received from SmartPass. The sequence number should correspond to the data message that is being positively or negatively acknowledged by the host. If SmartPass receives an ACK message with the incorrect sequence number, the data message is retransmitted. The host computer is responsible for resetting its anticipated data message sequence number to that of SmartPass before communications can resume without error.

<ack/nak>

ASCII @ character for ACK response; ASCII ? character for NAK response

<crc>

CRC for the message

<eom>

End-of-message character (ASCII CR)

SmartPass sets a user-programmable timeout delay at the time each message is transmitted (based on command 612NN, where NN = timeout delay). The timeout delay can be disabled for diagnostic purposes by setting NN = FF. If the timeout delay expires before SmartPass receives an ACK or NAK message from the host, a logical NAK condition will be declared. If SmartPass receives a NAK or timeout, the data message is retransmitted.

6-6

Page 105

Communication Protocols

6

When SmartPass receives an ACK message, the message is treated as having been properly received by the host. The sequence number is then incremented, and pointers are advanced to the next message in SmartPass’s message queue to prepare for sending the next message.

Switch to Command Mode Request The host may issue command 01 (switch to command mode) while in data mode. The basic protocol format is shown below.

<som><cmd><eom> The ECP format is shown below.

<som><seq><cmd><crc><eom> where:

<som>

Start-of-message (ASCII # character)

<seq>

The sequence number is generated by the host computer separately from that appearing in data messages transmitted by SmartPass.

<cmd>

Switch to command mode, command number (ASCII characters 01)

<crc>

CRC for the message

<eom>

End-of-message character (ASCII CR)

Host Transmission The host initiates synchronous communications between SmartPass and the host. The host begins a sequence by issuing a command; SmartPass will respond accordingly. The data inquiry protocol format is shown below.

<CTRL-E> The basic protocol format is shown below.

<som><cmd>[<data>]<eom> The ECP format is shown below.

<som><seq><cmd>[<data>]<crc><eom> where:

<CTRL-E>

ASCII Control E (hex 5 digits). When in data inquiry mode, each transmission of a CTRL-E by the host causes SmartPass to transmit one tag ID.

<som>

Start-of-message (ASCII # character)

6-7

Page 106

AI1620 SmartPass System Guide

Sequence number (ASCII hex digit) that represents an odd number in the range 1–9, A–F. The host should use odd sequence numbers in its command because SmartPass uses even sequence numbers in its transmissions. This method eliminates the possibility of a synchronous host command and an asynchronous reader transmission having the same sequence number.

<seq>

Upon receiving a host command, SmartPass is expected to echo the command’s sequence number in its response. Therefore, the host must update its sequence number upon receipt of a valid reader message. If the sequence number is not updated before transmission of the next command, SmartPass will not service the new command; it will retransmit its previous message. A command/message sequence is not considered compete until the host updates its sequence number.

<cmd>

Command code, a string that contains from two to four ASCII hex characters

[<data>]

Optional data field, an ASCII string of as many as 20 characters in length. For example, the set date command is 21MM/DD/YY (command 21 followed by the data string MM/DD/YY).

<crc>

CRC for the message

<eom>

End-of-message character (ASCII CR)

Reader Command Response The basic protocol format is shown below.

<som><resp><eom> The ECP format is shown below. <som><seq><resp><crc><eom> where:

6-8

<som>

Start-of-message (ASCII # character)

<seq>

Echo of sequence number received in host command message

<resp>

Response string. SmartPass will return Done, Error, or another ASCII string depending on the host transmission. This string can be as many as 72 characters long.

<crc>

CRC for the message

<eom>

End-of-message character (ASCII CR and LF)

Page 107

Communication Protocols

6

Sample Messages This section contains examples of typical messages transmitted between SmartPass and the host.

Reader Transmissions Basic protocol, reader transmission

#KING 1302&10:15:42.14 02/24/94<eom> Host response:

No host response for non-ECP ECP, reader transmission

#4KING 1302&10:15:42.14 02/24/94 <crc><eom> where:

#

Start-of-message character

4

Message sequence number

KING 1302

Message data: tag ID is shown. Other sample message data could be as follows: IOST C0 O2 I0 D24 (display I/O status) 04:35:42.45 11/26/95 (display time and date) Error03 (buffer status)

&10:15:42.14 02/24/94

Time and date

<eom>

End-of-message character

<crc>

CRC for the message

@

ACK (acknowledgment character)

(? returned for a negative acknowledgment) Host response:

#4@<crc><eom>

Host Command Transmissions Basic protocol, host transmission

#2010:15:00<eom> Reader response:

#Done<eom> or #Error<eom> #Error<eom> will be returned if the host transmission is not a legal command with legal data.

6-9

Page 108

AI1620 SmartPass System Guide

ECP, host transmission

#72010:15:00<crc><eom> where:

#

Start-of-message character

7

Message sequence number

20

Set time command10:15:00Set time data (Not all commands include data. For example, Turn RF off host transmission is #7640<eom> where 640 is the command number.)

<crc>

CRC for the message

<eom>

End-of-message character

Done

Command has been invoked by SmartPass.

Reader response:

#7Done<crc><eom> or #7Error<eom> For some commands, SmartPass will respond with data that relates to the command, such as TT 1, to indicate tag translation enabled for a 534 display tag translation mode command.

#7Error<eom> will be returned if host transmission is not a legal command with legal data.

Timing and Synchronization The ECP is largely independent of baud rate. The timeout delays previously described are a function of baud rate. SmartPass supports an ECP timeout, which applies equally to both transmit and receive. In addition, a protection mechanism has been implemented for SmartPass that prevents the assignment of mismatched ECP timeout and baud rate values. SmartPass will not allow the host to alter the ECP timeout (command 612NN) if the specified timeout is too short for the current baud rate. Conversely, SmartPass will not allow the host to alter the baud rate (command 100N) if the specified baud rate is too fast for the current ECP timeout. The receiver’s minimum timeout delay should equal the time to transmit/receive the longest anticipated message at the current baud rate setting. Additional margin should be included for idle periods between characters; for example, processing overhead, if any. The timeout delay period can be expressed as follows: Τrec (ms) = L x [Τchar + Τidle] where:

6-10

Τchar (ms)

1000 x [ Bc / Rb ]

Bc

Bits per character (typically 10)

Page 109

Communication Protocols

Rb

Baud rate (110–19.2 K)

L

Length of message in characters

Τidle

Maximum idle period between characters (ms)

6

Likewise, the sender must set a timeout delay equal to the delay of nine characters at the current baud rate setting; for example, the time required to shift out the <eom> character plus the time to shift in the ACK or NAK message to be received) plus a processing allowance for the receiver to process the message and check for error conditions. Thus, the sending timeout delay can be expressed as the following: Τsend (ms) = 9 * Τchar + Τerrchk where: Τerrckh (ms)

Processing period to perform error checking by receiver

SmartPass supports baud rates between 110 and 19.2 K. The host can remotely set the SmartPass’s communications parameters while in the command mode, but Amtech does not recommend this action if communications conditions are marginal. After SmartPass receives new communications parameters, SmartPass issues the Done message and switches to the new configuration immediately. It is the host computer’s responsibility to switch its own communications parameters immediately after the transaction is complete. As noted, the message initiator, such as SmartPass in data mode and the host computer in command mode, starts a timeout counter at the time a message is transmitted. If the timeout expires before receiving a message, a logical NAK condition is declared, and the message is assumed to have been received in error. In this instance, the message is retransmitted until a message is received. The message recipient, such as the host computer in data mode and SmartPass in command mode, starts a timeout counter when a <som> character is received. If the timeout expires without the receiver receiving an <eom>, the message acquisition is aborted (reset), and the receiver waits for the next <som> character. If a second <som> character is received before an <eom> character, the message acquisition is aborted (reset), and retransmission of the previous message is assumed to be underway. These strategies are designed to allow for graceful recovery during periods when communications are marginal or completely lost. It should be noted that while SmartPass is in command mode, all acquired tag IDs are buffered but not transmitted. Note: It is important that the host limit the period during which SmartPass remains in command mode to avoid overflowing SmartPass’s tag ID buffer and subsequently losing tag IDs.

6-11

Page 110

AI1620 SmartPass System Guide

Reader-Addressed Failure Conditions SmartPass addresses the following failure conditions.

Illegal Sequence Number (Not in the Range 0–9, A–F) If SmartPass detects an illegal sequence number in a host command message, it discards the received message and does not send a response. If it receives an illegal sequence number in an ACK message, it responds as if a NAK had been received and retransmits the data.

Wrong Sequence Number If SmartPass receives the wrong sequence number in an ACK message, it responds as if a NAK had been received (it retransmits the data).

Bad CRC If SmartPass detects a bad CRC in a host command message, it discards the received message. No response is sent. If it receives a bad CRC in an ACK message, it responds as if a NAK had been received, and it retransmits the data.

Illegal Command If SmartPass receives an illegal command, it returns its standard Error message.

Transmission Timeout If SmartPass transmits an asynchronous message and the host does not send an ACK before the ECP timeout occurs, SmartPass retransmits the message.

Receive Timeout If SmartPass receives a <som> but does not receive a matching <eom> before the ECP timeout occurs, it discards the incomplete message and resets its receiver.

Asynchronous Message/Command Message Collision If SmartPass transmits asynchronous data at the same time that the host sends a command, SmartPass gives priority to receiving the command. It processes the command and sends a message before it retransmits the asynchronous data.

Host-Addressed Failure Conditions The host addresses the following failure conditions.

Illegal or Wrong Sequence Number If the host detects an illegal or wrong sequence number in a reader response, it retransmits the command with the same sequence number. If the host detects an illegal sequence number in an asynchronous reader transmission, it sends a NAK message.

6-12