Programming
44
TTPM3 Printer/Encoder–Technical Manual
0705
4.6.9 Additional encoding information
CHECKSUM
To ensure correct reception of the message to be magnetically encoded, a checksum can
be appended to the data by the host computer. This checksum will then be compared by
the TTPM3 before encoding which guarantees that the magnetic code data is correctly
received.
1. Calculate the checksum as the modulo 2 sum (consecutive XOR) of the ASCII data
bytes sent in the !M command. The checksum must have bit 7 set to 1 to distinguish it
from ordinary data.
2. Append the checksum at the end of the !M data string when encoding ISO data at
track 2 (or center track).
3. When the message has been received, the TTPM3 calculates the checksum and
compares it to the checksum appended to the message. If they are identical, an ACK
is returned, otherwise a NAK followed by the checksum calculated by the TTPM3 will
be returned.
The checksum is never encoded on the magnetic stripe; it is only intended to secure data
transmission. The ISO format itself automatically adds a check digit to the magnetic code.
READING AND DECODING
MAGNETIC ENCODING ATTRIBUTES
The magnetic encoding data strings can be given attributes that govern versions of the
standard encode/read-after-write routines and cancellation functions.
The following attributes, inserted anywhere in the applicable data strings, will cause the
following functional deviations from default standards:
NOTE –
The attributes in parenthesis only work for the !M command
{ (or *)
Cancels the read-after-write function. The ticket is encoded and directly
transported forwards for separation (if applicable) and subsequent printing
according to the !F command data without prior read-after-write.
| (or $) Encodes the ticket, performs read-after-write, but does not transport the ticket
for printing. Instead, the ticket is backed into the active position without being
cut, waiting for the command to proceed, for instance, for a decode operation.
} (or @) Expands the read-after-write operation. If this is successful, the ticket is
processed in accordance with standard routines, that is, it is separated and
printed. If the read-after-write operation is unsuccessful in the programmed
number of attempts, the ticket is transported forwards, and the waste bin of the
front load mechanism is activated (only printers with front load & waste bin
option). The ticket is dropped into a waste bin.
|} ($@) Combining the characters | and } results in normal behavior if the encoding was
successful. If an error occurs then the ticket is transported back to the start
position and NAK + ‘E’ is sent.