3 response packet format, 2 optional serial command mode, Section 5.2.1.3 – INFICON STM-2 USB Thin Film Rate/Thickness Monitor User Manual

Page 74

Advertising
background image

5 - 6

PN

07

4-

61

3-

P1

A

STM-2 Operating Manual

5.2.1.3 Response Packet Format

<STX><ADDR><CMD_RSP>[<DATA>...]<CKSUM1><CKSUM2><CR>

NOTE: In the CMD_RSP byte, the CMD bits are unchanged from the master, but

the RSP bits are filled in according to the status of the slave.

Where <RSP> is:
1

OK

Command understood and executed.

2

Err_Inv_cmd

Illegal command (CMD code not valid).

3

Err_syntax

Syntax error (too many bytes in data field, not
enough bytes).

4

Err_range

Data range error.

5

Err_inh

Inhibited.

6

Err_obso

Obsolete command. No action taken.

5.2.2 Optional Serial Command Mode

SMDP (version 3 and greater) allows for a serial number in the command to
associate a command from the master with the correct response. This detects
errors in serial communications ports where commands are queued and sent out
of order. The protocol structure is nearly identical to

section 5.2, Sycon Multi-Drop

Protocol (SMDP), on page 5-1

, except:

A serial number byte must be placed before the checksum bytes. This must be
a value greater than or equal to 0x10 (16), otherwise it could be mistaken as a
framing or escape character byte (see

section 5.2.2.1

). This byte is summed as

a part of the packet payload in computing the packet checksum value.

The checksum character base must be hexadecimal 40 (@), instead of
hexadecimal 30 (0) to inform the slave that it is receiving a packet with the extra
SRLNO field postamble. This makes the last two characters of the command
(the checksums) range from @ (0x40) through the letter, O (0x4f).

For a response, the slave places the corresponding SRLNO byte into its
response packet just before the two reply packet checksum characters, also
0x40 based.

In order for this serial command mode to be effective, the master should generate
a new SRLNO value for each command that it sends (modulo 255, and greater
than 0x10). This allows for 240 unique serial number values before repeating. The
value could be an incrementing tag that rolls over from 255 to 16 with the
understanding that there would never be 240 outstanding messages. Alternatively,
the tag could have a unique value or range of values for each line of communication
to the product at a specific address. This will allow the responses to be received by
the proper line of communication.
NOTE: When an SMDP response packet is received by the master, verify the

SRLNO value and use it to associate it with the source of the
command/query. This will prevent out-of-sequence replies from being
misinterpreted and invalid results being generated.

Advertising