You are on page 1of 20

Z303

1
Communication protocol
1 General description
The document gives a description of the serial communication protocol to allow the connec-
tion of one or more Z303 printing systems to a PC.

2 Generic data sequence
The generic data sequence is:
Index:
0 $ String start character (ASCII 36)
1 Master Address Serial address of the console. Hexadecimal: it can be 0-15
(a character of value 0-F)
2 Slave Address Always set at 0 (zero). Z3000 do not foresee this address
3-4 XX Identifcation of the data string format (2 characters)
5-... Data Data string (80 characters maximum)
Data format depends on the above mentioned identifcation
... Checksum 2 characters for checksum.
Sendig a message to the system, they can be substituted by 2
SPACE characters (ASCII 32)
... CR String end character (Carriage Return: ASCII 13)
IMPORTANT!
Data string does not have to contain the $ character.
SERIAL LINE
RS232C / RS485
PAGE
COMMUNICATION PROTOCOL
2
Z303
3 Serial line specifcations
Serial line is available on a 9 pins male socket connector, situated on the side part of the
cabinet.
Properties:

SERIAL LINE (HOST COMPUTER) RS232C/RS422/RS485 - Programmable
START BIT 1
STOP BIT 1
DATA LENGTH 8 bits
BAUD RATE 4800, 9600, 19200 bit/s
PARITY BIT not present
FLOW CONTROL none
The connector plug has the following signals (front view):
1. 6. TX- (422)
2. RX232 7. TX+ (422)
3. TX232 8. RX- (422/485)
4. +5 Vdc or +24 Vdc 9. RX+ (422/485)
5. GND
Connection to a pc through serial line RS232
4 Writing text messages
To send a text message to the system, send the sequence:
5 4 3 2 1
8 7 9 6
COMMUNICATION PROTOCOL
PAGE
Z303
3
Index:
0 $ String start character
1 MA Serial address of the console
2 SA Always set to 0 (zero)
3-4 WT Identifcation of the data string format: Write Text (2 characters)
5-7 nnn Code reference number for text message (000-199)
8 m Print mode: A: Normal B: Reversed (upside-down)
C: Inverted D: Reversed and Inverted
9-... xxx... Text message (80 characters maximum)
... Blank Space 2 characters ASCII 32 or 2 characters for checksum
... CR String end character (ASCII 13)
The system will send back the following string:
Index:
0 $ String start character
1 MA Serial address of the console
2 SA Always set to 0 (zero)
3-4 OK Communication OK (2 characters)
5 CR String end character
5 Reading text messages
To read a text from the system, send this character sequence:

Index:
0 $ String start character
1 MA Serial address of the console
2 SA Always set to 0 (zero)
3-4 RT Identifcation of the data string format: Read Text (2 characters)
5-7 n Code reference number for text message (000-199)
8-9 Blank Space 2 characters ASCII 32 or 2 characters for checksum
10 CR String end character (ASCII 13)
The system will send back the following string:
PAGE
COMMUNICATION PROTOCOL
4
Z303
Index:
0 $ String start character
1 MA Serial address of the console
2 SA Always set to 0 (zero)
3-4 RT Identifcation of the data string format: Read Text (2 characters)
5-7 n Code reference number for text message (000-199)
8 m Print mode: A: Normal B: Reversed (upside-down)
C: Inverted D: Reversed and Inverted
9-... xxx... Text message
... CK 2 characters for checksum
... CR String end character (ASCII 13)
6 Reading the parameters
The following parameters can be read from the system:
Speed 00000-32767
Code reference number of text message selected 000-199
Print delay 00000-65535
Encoder: enabled/disabled 1=YES, 0=NO
BCD: enabled/disabled 1=YES, 0=NO
BCD strobe: enabled/disabled 1=YES, 0=NO
BCD block 0-6
Automatic Print Repeater: enabled/disabled 1=YES, 0=NO
Product Sensor: enabled/disabled 1=YES, 0=NO
Repeater Time 00000-09999
Starting time Shift 1 00-23
Starting time Shift 2 00-23
Starting time Shift 3 00-23
Starting time Shift 4 00-23
Printer Model 3-4 (3=Z303 16 dots; 4=Z303 7 dots)
Common Print Start: enabled/disabled 1=YES, 0=NO
Send the following characters sequence:
Index:
0 $ String start character
1 MA Serial address of the console
2 SA Always set to 0 (zero)
3-4 RP Identifcation of the data string format: Read Parameters (2 characters)
5-6 Blank Space 2 characters ASCII 32 or 2 characters for checksum
7 CR String end character (ASCII 13)
COMMUNICATION PROTOCOL
PAGE
Z303
5
The system will reply:
Index:
0 $ String start character
1 MA Serial address of the console
2 SA Always set to 0 (zero)
3-4 RP Identifcation of the data string format: Read Parameters (2 characters)
5-9 vvvvv Speed Value (5 digits)
10-12 nnn Code reference number of text message selected for printing (3 digits)
13-17 rrrrr Print delay (5 digits)
18 ... Encoder enabled/disabled
19 ... BCD enabled/disabled
20 ... BCD strobe enabled/disabled
21 ... BCD block (1 digit)
22 ... Automatic print repeater enabled/disabled (1 digit)
23 ... Product sensor enabled/disabled (1 digit)
24-28 ... Repeater time (5 digits)
29-30 aa Starting time shift 1 (2 digits)
31-32 bb Starting time shift 2 (2 digits)
33-34 cc Starting time shift 3 (2 digits)
35-36 dd Starting time shift 4 (2 digits)
37 m Printer model: 3-4 (3=Z303 16 dots; 4=Z303 7 dots)
38 s Bit direction
39-40 CK 2 characters for checksum
41 CR String end character
7 Setting the parameters
Send the following characters sequence:
Index:
0 $ String start character
1 MA Serial address of the console
2 SA Always set to 0 (zero)
3-4 RP Identifcation of the data string format: Read Parameters (2 characters)
5-9 vvvvv Speed Value (5 digits)
10-12 nnn Code reference number of text message selected for printing (3 digits)
13-17 rrrrr Print delay (5 digits)
18 ... Encoder enabled/disabled
19 ... BCD enabled/disabled
20 ... BCD strobe enabled/disabled
21 ... BCD block (1 digit)
22 ... Automatic print repeater enabled/disabled (1 digit)
PAGE
COMMUNICATION PROTOCOL
6
Z303
23 ... Product sensor enabled/disabled (1 digit)
24-28 ... Repeater time (5 digits)
29-30 aa Starting time shift 1 (2 digits)
31-32 bb Starting time shift 2 (2 digits)
33-34 cc Starting time shift 3 (2 digits)
35-36 dd Starting time shift 4 (2 digits)
37 m Printer model: 3-4 (3=Z303 16 dots; 4=Z303 7 dots)
38 s Bit direction
39-40 Blank Space 2 characters ASCII 32 or 2 characters for checksum
41 CR String end character
The system will reply with the sequence shown at paragraph 4:
8 Reading the values of the counters
The character sequence needed to read the vauels of the counter is:
Index:
0 $ String start character
1 MA Serial address of the console
2 SA Always set to 0 (zero)
3-4 RC Identifcation of the data string format: Read Counters (2 characters)
7-8 Blank Space 2 characters ASCII 32 or 2 characters for checksum
9 CR String end character
The system will reply:
Index:
0 $ String start character
1 MA Serial address of the console
2 SA Always set to 0 (zero)
3-4 RC Identifcation of the data string format: Read Counters (2 characters)
5-14 n...n Set value incremental counter *
15-24 l...l Present value incremental counter *
25-34 u...u Set value decremental counter *
35-44 a...a Present value decremental counter *
45-54 p...p Batch *
COMMUNICATION PROTOCOL
PAGE
Z303
7
55-59 q...q Present value batch **
60-64 t...t Set value batch **
65-66 ss Counter step (01-99)
67-68 CK 2 characters for checksum
69 CR String end character
* 10 characters ASCII: the frst character is a SPACE, then 9 characters which repre-
sent the counter value, maximum 999999999.
** 5 characters ASCII representing the counter value, maximum 99999.
9 Setting the counters
The character sequence needed to set the counter is:
Index:
0 $ String start character
1 MA Serial address of the system
2 SA Always set to 0 (zero)
3-4 WC Identifcation of the data string format: Write Counters (2 characters)
5-14 n...n Set value incremental counter *
15-24 l...l Present value incremental counter *
25-34 u...u Set value decremental counter *
35-44 a...a Present value decremental counter *
45-54 p...p Batch *
55-59 q...q Present value batch **
60-64 t...t Set value batch **
65-66 ss Counter step (01-99)
67-68 Blank Space 2 characters ASCII 32 or 2 characters for checksum
69 CR String end character
* 10 characters ASCII: the frst character is a SPACE, then 9 characters which repre-
sent the counter value, maximum 999999999.
** 5 characters ASCII representing the counter value, maximum 99999.
The system will reply with the sequence shown at paragraph 4:
PAGE
COMMUNICATION PROTOCOL
8
Z303
10 Reading the reports
To read the report of a specifc text message, send the following character sequence:
Index:
0 $ String start character
1 MA Serial address of the console
2 SA Always set to 0 (zero)
3-4 RR Identifcation of the data string format: Read Reports (2 characters)
5-7 nnn Code reference number of the text message (000-199)
8-9 Blank Space 2 characters ASCII 32 or 2 characters for checksum
10 CR String end character
The system will reply:
Index:
0 $ String start character
1 MA Serial address of the console
2 SA Always set to 0 (zero)
3-4 RR Identifcation of the data string format: Read Reports (2 characters)
5-7 nnn Code reference number of the text message (000-199)
8 Space
9-17 r...r The number of times the message has been printed (9 characters)
18 Space
19-27 r...r The number of times the message has been verifed by the scanner
(9 characters, always 000000000)
29-29 CK 2 characters for checksum
30 CR String end character
11 Setting reports to zero (0)
To set the report value for a particular text message to zero (0), send this character sequen-
ce:
COMMUNICATION PROTOCOL
PAGE
Z303
9
Index:
0 $ String start character
1 MA Serial address of the console
2 SA Always set to 0 (zero)
3-4 CR Identifcation of the data strig format: Clear Reports (2 characters)
5-7 nnn Code reference number of the text message (000-199) the report of
which is to be clared
By sending the character A (All) into the 5th position of the string, all the
reports will be cleared.
8-9 Blank Space 2 characters ASCII 32 or 2 characters for checksum
10 CR String end character
The system will reply with the sequence shown at paragraph 4:
12 Software release reading
Sending the sequence:
Index:
0 $ String start character
1 MA Serial address of the console
2 SA Always set to 0 (zero)
3-4 RL Identifcation of the data string format: Read reLease (2 characters)
5-6 Blank Space 2 characters ASCII 32 or 2 characters for checksum
7 CR String end character
The system will reply with its name and the software release installed:
Index:
0 $ String start character
1 MA Serial address of the console
2 SA Always set to 0 (zero)
3-4 RL Identifcation of the data string format: Read reLease (2 characters)
5-... n...n System name and software release
... CK 2 characters for checksum
... CR String end character
PAGE
COMMUNICATION PROTOCOL
10
Z303
13 Setting the printing message code
The following sequence sets the code reference number for the message to be printed:
Index:
0 $ String start character
1 MA Serial address of the console
2 SA Always set to 0 (zero)
3-4 WM Identifcation of the data string format: Write Message (2 char.)
5-7 nnn 3 characters to set the printing message code (000-199)
8-9 Blank Space 2 characters ASCII 32 or 2 characters for checksum
10 CR String end character
The system will send back:
Index:
0 $ String start character
1 MA Serial address of the console
2 SA Always set to 0 (zero)
3-4 RT Identifcation of the data string format: Read Text (2 characters)
5-7 nnn Message number (000-199)
8 m Print mode: A: Normal
B: Reversed (upside-down)
C: Inverted (from the end to the beginning)
D: Reversed and Inverted
9-.. x...x Text of the message
... CK 2 characters for checksum
... CR String end character (ASCII 13)
14 Reading the printing message code
Send this sequence:
COMMUNICATION PROTOCOL
PAGE
Z303
11
Index:
0 $ String start character
1 MA Serial address of the console
2 SA Always set to 0 (zero)
3-4 RM Identifcation of the data string format: Read Message (2 characters)
5-6 Blank Space 2 characters ASCII 32 or 2 characters for checksum
7 CR String end character
The system will send back:
Index:
0 $ String start character
1 MA Serial address of the console
2 SA Always set to 0 (zero)
3-4 RT Identifcation of the data string format: Read Text (2 characters)
5-7 nnn Message number (000-199)
8 m Print mode: A: Normal
B: Reversed (upside-down)
C: Inverted (from the end to the beginning)
D: Reversed and Inverted
9-.. x...x Text of the message
... CK 2 characters for checksum
... CR String end character (ASCII 13)
15 Time and date setting
Send the following sequence to set time and date of the system:
Index:
0 $ String start character
1 MA Serial address of the console
2 SA Always set to 0 (zero)
3-4 WK Identifcation of the data string format: Write clocK (2 characters)
5-6 oo Hours (00-23)
7-8 tt Minutes (00-59)
9-10 ss Seconds (00-59)
PAGE
COMMUNICATION PROTOCOL
12
Z303
11-12 gg Day (01-31)
13-14 mm Month (01-12)
15-16 aa Year (last two digits 00-99)
17 d Day of the week (1-7 (with 1=monday))
18-19 Blank Space 2 characters ASCII 32 or 2 characters for checksum
20 CR String end character
The system will reply with the sequence shown at paragraph 4:
16 Time and date reading
The current time and date used by the system can be read sending the following sequence:
Index:
0 $ String start character
1 MA Serial address of the console
2 SA Always set to 0 (zero)
3-4 RK Identifcation of the data string format: Read clocK (2 characters)
5-6 Blank Space 2 characters ASCII 32 or 2 characters for checksum
7 CR String end character
The system will reply:
Index:
0 $ String start character
1 MA Serial address of the console
2 SA Always set to 0 (zero)
3-4 RK Read clocK (2 characters)
5-6 oo Hours (00-23)
7-8 tt Minutes (00-59)
9-10 ss Seconds (00-59)
11-12 gg Days (01-31)
13-14 mm Month (01-12)
15-16 aa Year (last two digits 00-99)
COMMUNICATION PROTOCOL
PAGE
Z303
13
17 d Day of the week (1-7 (with 1=monday))
18-19 CK 2 characters for cheksum
20 CR String end character
17 Unknown command
When the system does not recognize the command received from the PC (if the system ad-
dress and the checksum are correct), the following sequence will be sent back:
Index:
0 $ String start character
1 MA Serial address of the console
2 SA Always set to 0 (zero)
3-7 ?UNKN UNKNown message (5 characters)
8 [
9-13 .... The frst 5 caracters of the received message, including the system
address but the character $
14 ]
15 CR String end character
18 Checksum control
To increase PC data transmission reliability, instead of two SPACE characters (ASCII 32),
the system can process two hexadecimal checksum characters.
The checksum has to be calculated as the sum of all the caracters transmitted by the PC,
including and starting from the character $. The checksum must be a number smaller than
256; if bigger or equal, you must subtract 256. Once calculated, the checksum must be tran-
smitted in hexadecimal format.
Example:
Message Checksum Checksum characters to be transmitted
$00WT000ABCD 36+48+48+87+84+48+48+48+65+66+67+68 = 713
713-256=457 -> 457-256=201 -> C9
If the checksum sent to the system was not calculated in this way or if the system receives a
wrong checksum because of signal noise, the following sequence will be sent back from the
system:
PAGE
COMMUNICATION PROTOCOL
14
Z303
Index:
0 $ String start character
1 MA Serial address of the console
2 SA Always set to 0 (zero)
3-8 ?CKSUM Wrong checksum, ChecKSUM (6 characters)
9 = Equal symbol
10-11 XX Sum of all the characters received by the system (including the
checksum sent by the PC and with the exception of the CR character)
codifed in an exadecimal format.
12 CR String end character
19 Logo writing
It is possible to send until 26 graphic images to the system. The 26 images are numbered
using a three digits (000-025) and the dimensions are (until) 16 lines by (until) 50 columns.
The dots columns composing the graphic image, numbered fro 01 to 50, are sent using the
following sequence:
Index:
0 $ String start character
1 MA Serial address of the console
2 SA Always set to 0 (zero)
3-4 LW Identifcation of the data string format: Logo Write (2 characters)
5-7 nnn Logo number (000-025)
8-9 hh Height (01-16)
10-11 ww Width (01-50)
12-19 cccc First column value (4 byte) in exadecimal
20-... r..r Eventual other columns values (4 byte per column) in exadecimal
...-... Blank space 2 characters ASCII 32 or 2 characters for checksum
... CR String end character
The system will send back the same sequence of the paragraph 4:
COMMUNICATION PROTOCOL
PAGE
Z303
15
20 Logo reading
To read a logo stored in the system, send the following sequence:
Index:
0 $ String start character
1 MA Serial address of the console
2 SA Always set to 0 (zero)
3-4 LE Identifcation of the data string format: Logo rEad (2 characters)
5-7 nnn Logo number (000-025)
8-9 Blank space 2 characters ASCII 32 or 2 characters for checksum
10 CR String end character
The system send back:
Index:
0 $ String start character
1 MA Serial address of the console
2 SA Always set to 0 (zero)
3-4 LE Identifcation of the data string format: Logo rEad (2 characters)
5-7 nnn Logo number (000-025)
8-9 hh Height (01-16)
10-11 ww Width (01-50)
12-19 cccc First column value (4 bytes) in exadecimal
20-... r..r Values of the other columns (4 bytes per column) in exadecimal
...-... CK 2 characters for checksum
... CR String end character3
21 Alarm reading
Send this sequence:
PAGE
COMMUNICATION PROTOCOL
16
Z303
Index:
0 $ String start character
1 MA Serial address of the console
2 SA Always set to 0 (zero)
3-4 RA Identifcation of the data string format: Read Alarm (2 characters)
5-6 Blank Space 2 characters ASCII 32 or 2 characters for checksum
7 CR String end character
The system will reply:
Index:
0 $ String start character
1 MA Serial address of the system
2 SA Always set to 0 (zero)
3-4 RA Identifcation of the data string format: Read Alarm (2 characters)
5-6 aa Alarms/inputs 0-7 status *
7-8 bb Alarms/inputs 8-15 status (not used)
9-10 cc Alarms/inputs 16-23 status (not used)
11-12 dd Alarms/inputs 24-31 status (not used)
13 m System model: 3-4 (3=Z303 16 dots; 4=Z303 7 dots)
14 s Selectes system status **
15-16 CK 2 characters for checksum
17 CR String end character
* The pair digits (aa) holds the value of one byte hexadecimal format.
The 8 bits of the byte represent the status of 8 alarms/inputs.
For example, aa = 01 means: alarm/input #0 on (1 value) it is an high value;
alarms/inputs #1-7 off (0 value) are low.
Example:
** the character establishing the state of the system can be:
0 OFFLINE
1 ON LINE
2 WAITING
3 HV ON
4 WARNING
5 INK ON
6 FLUSHING
The only alarm present on the Z303 system is the Low Level Ink marked by the input
aa=5
COMMUNICATION PROTOCOL
PAGE
Z303
17
22 Special parameters setting
In order to set the special parameters (dedicated), send the following sequence:
Index:
0 $ String start character
1 MA Serial address of the system
2 SA Always set to 0 (zero)
3-4 WD Identifcation of the data string format: Write Dedicated (2 characters)
5 a Always set to 0 (zero)
6 b Facing printheads enabled/disabled (1=Yes, 0=No)
7 c Ink missing enabled/disabled (1=Yes, 0=No)
8 d Common fle enabled/disabled (1=Yes, 0=No)
9 e Always set to 0 (zero)
10 f Always set to 0 (zero)
11 g Dot size (0-5)
12-17 h Always set to 0 (zero)
18-20 i Printhead misalignement (0-225)
21-54 j Always set to 0 (zero)
55-56 Blank space 2 characters ASCII 32 or 2 characters for checksum
57 CR String end character
The system will send back the same sequence of the paragraph 4:
23 Special parameters reading
Per leggere i parametri speciali (dedicati), inviare la seguente sequenza di caratteri:
PAGE
COMMUNICATION PROTOCOL
18
Z303
Index:
0 $ String start character
1 MA Serial address of the system
2 SA Always set to 0 (zero)
3-4 RD Identifcation of the data string format: Read Dedicated (2 characters)
5-6 Blank space 2 characters ASCII 32 or 2 characters for checksum
7 CR String end character
The system will reply:
Index:
0 $ String start character
1 MA Serial address of the system
2 SA Always set to 0 (zero)
3-4 WD Identifcation of the data string format: Write Dedicated (2 characters)
5 a Always set to 0 (zero)
6 b Facing printheads enabled/disabled (1=Yes, 0=No)
7 c Ink missing enabled/disabled (1=Yes, 0=No)
8 d Common fle enabled/disabled (1=Yes, 0=No)
9 e Always set to 0 (zero)
10 f Always set to 0 (zero)
11 g Dot size (0-5)
12-17 h Always set to 0 (zero)
18-20 i Printhead misalignement (0-225)
21-54 j Always set to 0 (zero)
55-56 CK 2 characters for checksum
57 CR String end character
24 Special characters
A combination of characters (control characters) is used to insert within a message special
functions (date, expiration, etc.), to set a new font matrix, to insert a logo and many more.
In case you are sending the messages from a Personal Computer, these
characters must be sent via serial line.
WARNING:
hereafter the character ^ is the ASCII 94 character
COMMUNICATION PROTOCOL
PAGE
Z303
19
^Ac^ Actual year c = year digits number 0 = 2 digits
1 = 4 digits
2 = 0 digits
3 = 1 digit
^A+nnc^ Expiration year nn = years to add to the actual year
c = year digits number 0 = 2 digits
1 = 4 digits
2 = 0 digits
3 = 1 digit
^C^ Actual day
^C+nnndfcl^ Expiration day nnn = days to add to the actual date
d = separator (any character)
f = format 0 = D M Y
1 = D Y M
2 = M Y D
3 = M D Y
4 = Y M D
5 = Y D M
c = year digits number 0 = 2 digits
1 = 4 digits
2 = 0 digits
3 = 1 digit
l = month language: 0 = english
1 = italian
2 = german
3 = french
4 = spanish
5 = portuguese
6 = number
^D^ Tower print
^Gc^ Logo (starting from the top) c = logo identifer (in letter)
^Hl^ Actual month l = month language: 0 = english
1 = italian
2 = german
3 = french
4 = spanish
5 = portuguese
6 = number
^H+nndfcl^ Expiration month nn = months to add to the actual month
d = separator (any character)
f = format 0 = M Y
1 = Y M
c = year digits number 0 = 2 digits
1 = 4 digits
2 = 0 digits
3 = 1 digit
PAGE
COMMUNICATION PROTOCOL
20
Z303
l = month language: 0 = english
1 = italian
2 = german
3 = french
4 = spanish
5 = portuguese
6 = number
^Ixxx^ Link to messages xxx = number of the message to link
^J^ Day of the week (1-7, with 1 = monday)
^Knn^ Bold nn = 00-15 (default value = 1)
^Lcx^ Batch c = format + = show zeroes true
- = show zeroes false
x = batch digits number (1-9)
^M^ Actual minutes
^Nx^ Font x = font type 0 = 5x5
1 = 7x5
2 = 9x7 (only in 16 dots)
3 = 16x10 (only in 16 dots)
^O^ Actual hours
^Pvvvvvdrrrrr^ Printing parameters vvvvvv = speed (00000-00255)
d = dot size (0-5)
rrrrr = printing delay (00001-65535)
^Qn^ Interline n = 0-6 (only in 16 dots printheads)
^S^ Sequential week
^T^ Shift
^Ucx^ Incremental counter c = format + = show zeroes true
- = show zeroes false
x = counter digits number (1-9)
^Vc^ Logo (in the actual position) c = logo identifer (in letter)
^Wcx^ Decremental counter c = format + = show zeroes true
- = show zeroes false
x = counter digits number (1-9)
^Y^ Julian day (or sequential)
^Z^ New line (only in 16 dots printheads)
COMMUNICATION PROTOCOL
PAGE

You might also like