Communications Protocol - Promag TR515 User Manual

Time recorder
Table of Contents

Advertisement

3. Communications protocol

The TR515 communications protocol is based on the GNET protocol
specification. Communications parameters are 19200-8-N-1.
Communications between the TR515 and the PC takes place in the form of
commands sent by the PC and replies from the TR515. Commands and replies
are packets of data. Each packet begins with an STX (02H) character and ends
with CR (0DH) character. Selected commands and replies include a checksum
field as an additional safety measure. All characters between the STX and the
CR characters must be in the 20H...7FH range.
The STX character of a command packets is followed by a one-character
command code. The STX character of a reply packet is followed by a one-
character reply code. Both command and reply packets may contain some
relevant data after the command (reply) character:
Cmd/Rpl
STX
code
02H
*
Checksum field is not included into certain commands and replies
All available commands are described later in this Section. Of reply codes,
only two are possible: 'A' (completed successfully) and 'N' (some error was
encountered). Depending on the command given to the TR515, reply packets
with reply code 'A' may contain some data (as shown on the Figure above).
Reply packets with the reply code 'N' always contain a 2-digit error code that
can be used to analyze the source of a problem.
The checksum is an 8-bit sum of all characters between the STX and CR,
represented as a 2-character HEX string. For an example packet below, the
checksum is calculated as follows. The data part of the packet is "A1XYZ". The
sum of these character codes is: 41H+31H+58H+59H+5AH=17DH. Eight least
significant bits contain 7DH. The string representation of this value is "7D" (i.e. 2
ASCII characters- '7' and 'D').
STX
A
02H
41H
Packet portion the checksum is calculated on
TR515 User's Manual
Data (if any)
1
X
31H
58H
59H
Checksum*
Y
Z
7
5AH
37H
Checksum
8
C1
C2
CR
0DH
D
CR
44H
0DH

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents