5 - 6
IP
N 07
4-
51
1-
P1
C
SQM-160 Operating Manual
5.3 SQM-160 Communications Protocol
The SQM-160 communicates with a host computer via an ASCII based protocol.
The SQM-160 defaults to 19,200 baud, 8 data bits, and no parity. The baud rate
can be changed in the System Menu of the SQM-160, but is always 8 data bits with
no parity.
The command protocol sent to the SQM-160 is:
<sync character> <length character> <1 to n data characters> <CRC1><CRC2>
The sync character is an exclamation point '!'. Anytime this character is received,
the communications for that packet is reset. The sync character is not included in
the CRC calculation. Following the sync character is the length character. This is
the number of characters in the packet (not counting the sync, length, and CRC
characters). This character has a decimal 34 added to it so there cannot
accidentally be a sync character (!) embedded in the packet.
Following the length character are the command and data characters as detailed
in section
. After the data come two CRC characters.
NOTE:
If you do not want to use CRC checking in your application, send two Null
characters (CHR$0) for the CRC. The SQM-160 will ignore the CRC. The
SQM-160 will still return a CRC in its response, but you can ignore it.
The CRC is computed using the following algorithm:
1
The CRC is initialized to 3FFF hex.
2
Each character in the message is examined, bit by bit, and added to the CRC
in the following manner:
2a
The character is exclusive OR’d with the CRC.
2b
The CRC is shifted right one bit position.
2c
If bit position 0 has a value of 1 before each shift, the CRC is exclusive OR’d
with 2001 hex. This is done a total of 8 times per message character.
3
Step 2 is repeated for each character in the message (excluding the sync and
length characters).
4
Mask the contents of the CRC by logical AND with 3FFF hex.
5
The CRC contains 14 significant bits. This is split into two pieces of 7 bits each.
A decimal 34 (22 hex) is added to each CRC in order to avoid there being an
embedded sync character.
5a
Extract bits 0 - 6 of the CRC and add a decimal 34 (22 hex). This is CRC1.
5b
Extract bits 7 - 13 of the CRC and add a decimal 34 (22 hex). This is CRC2.
NOTE:
Sync characters are not included in the CRC calculation.
Summary of Contents for SQM-160
Page 1: ...O P E R A T I N G M A N U A L SQM 1 60 Multi Film Rate Thickness Monitor IPN 074 511 P1C ...
Page 2: ......
Page 5: ......
Page 6: ......
Page 8: ......
Page 22: ...1 10 IPN 074 511 P1C SQM 160 Operating Manual This page is intentionally blank ...
Page 30: ...2 8 IPN 074 511 P1C SQM 160 Operating Manual This page is intentionally blank ...
Page 60: ...4 12 IPN 074 511 P1C SQM 160 Operating Manual This page is intentionally blank ...
Page 76: ...5 16 IPN 074 511 P1C SQM 160 Operating Manual This page is intentionally blank ...
Page 98: ...6 22 IPN 074 511 P1C SQM 160 Operating Manual This page is intentionally blank ...
Page 110: ...8 8 IPN 074 511 P1C SQM 160 Operating Manual This page is intentionally blank ...
Page 120: ...A 10 IPN 074 511 P1C SQM 160 Operating Manual This page is intentionally blank ...