Sie sind auf Seite 1von 25

Willett Simple Protocol

Supported on the following machines:

Willett 370

Willett 400 Series

Willett 280 (280i and 280c) - all except message


packets

Simple Protocol
Provides easy access to the printer
from any RS232 system.
Enables simple data exchange between
the printer and another device.
The device must create and format the data
before sending it to the printer.

Advantages of Simple Protocol


(for a Company)
Provides an upgrade path for Willett
customers with older products.
Allows communication with PLCs which are not
flexible enough to operate more complex protocols.
Provides a fast, lightweight protocol for use in
higher speed printing applications.

Advantages of Simple Protocol


(for a Programmer)
Can be used with any system that can access
the RS232 port.

More compact than the Full Protocol, meaning that


software is smaller and more efficient.

Limitations of Simple Protocol


Does not support operation over a modem
link or RS485 multi-drop environment.

Does not support the creation or deletion of


messages, user fields and logos.

Data Exchange using


Simple Protocol I
Performed using packets between
the printer and the control PC.
Messages

12 Different packet types


can be exchanged.

Very simple packet structure.

Willett Printer

Messages
PC

Data Exchange using


Simple Protocol II
How communication with the printer is performed:
1. The master (e.g. control PC) creates the packet.
2. The packet is transmitted to the slave (printer).
3. The printer replies with either a 3-character
check sequence containing the modulo 256 sum of
all characters between [STX] and [ETX], or a
packet containing the data requested.

Simple Protocol Packet Structure


Part I
Each protocol packet sent to the machine
must adhere to the following general format:

[STX] [TYPE] [DATA] [ETX]


[STX]: Start of protocol packet.
[TYPE]: Type of protocol packet sent.
[DATA]: The data transmitted.
[ETX]: End of protocol packet.

Simple Protocol Packet Structure


Part II
[STX] is a fixed single ASCII character (02h) and is
used to indicate the start of a protocol packet.
[DATA] is a multiple ASCII character field, where all
character codes are within the range ASCII 20h to
FFh plus 0AH.
[ETX] is a fixed single ASCII character (03h) and is
used to indicate the end of a protocol packet.

Simple Protocol Packet Structure


Part III
[Type] is a single ASCII character in the range A to Z used
to describe the type of protocol packet which is being sent.
Message Type
Message Select
Delete Message Text
Update Message Text
Set Message Parameters
Delete User Field Data
Update User Field Data
Update Logo Data
Set Module Widths
Request Part Number
Start Jet
Stop Jet
Return Error Status

ASCII ID
M
C
T
P
D
U
L
B
H
J
K
E

How to use the Simple Protocol


(Request Part Number Example)
Create Message >> Transmit >> Wait for reply
Create the
Request Part
Number Packet
([STX]H[ETX]) -

Transmit the
packet

to the printer

Process the
returned
packet.
Perform an
operation and
return results.

How to use Simple Protocol in


Visual Basic 5.0/6.0
Source code (Send data)
OpenacommunicationChannelbetweenthePCand
theCOMPort
Open"COM1:"forBinaryas#1
Sendthefirstcharacterthatisthe[STX]
identifier
Put#1,,2
Sendarequestforthepartnumber
Put#1,,AscB("H")
Sendthelastcharacterthatisthe[ETX]
identifier
Put#1,,3
Close#1

Packet Type:
Message Select (M)
Select a message to print from the list of existing
messages stored in the machine.

[STX] [TYPE] [MESSAGE NAME] [ETX]


M<MESSAGE NAME>
Example:
MANDY

Packet Type:
Delete Message Text (C)
Clear all existing text from the message currently
being printed - leave the message content blank
and the message parameters unchanged.

[STX] [TYPE] [ETX]


C

Packet Type:
Update Message Text (T) Part I
Update the content of the message currently being
printed in line with the new data supplied in the
data field of the packet.
[STX] [TYPE] [MESSAGE DATA 1] [SEP] [MESSAGE DATA n] [ETX]

T<DATA 1><SEP><DATA 2>


Example:
T05000100200251Some Text

Packet Type:
Update Message Text (T) Part II
MESSAGE DATA Field Format
Each message data field is of the following format:
[FONT NUM] [HORC] [VERC] [ATTRIB] [MESSAGE TEXT]

Font No.

Horc

Verc

Attrib

Message Text

T05000100200251Some Text

Packet Type:
Set Message Parameters (P)
Update the print parameters associated with the message
currently being printed in line with the new parameter list
supplied in the data field of the packet.
[STX] [TYPE] [REV] [INV] [WID] [EHT] [GAP]
[EXP] [DLY] [BLD] [DRP] [NLN] [ETX]
INV
GAP
REV WID EHT

EXP

DLY

DRP
NLN
BLD

P01055021000200010002121

Packet Type:
Delete User Field Data (D)
Clear data from an existing named user field,
leaving the user field blank.
[STX] [TYPE] [USER FIELD NAME] [ETX]

D<MESSAGE1>
Example:
DCtr1

Packet Type:
Update User Field (U)
Update the data within an existing named user
field in line with the new data supplied in the
data field of the packet.
[STX] [TYPE] [USER FIELD NAME] [SEP] [USER FIELD DATA] [ETX]

U<USER FIELD> <DATA>


Example:
UCtr1 01A

Packet Type:
Update Logo Data (L)
Update the bit pattern of an existing named logo in
line with the new data supplied in the data field of
the packet
[STX] [TYPE] [LOGO NAME] [SEP] [NUM DROPS]
[NUM RASTERS] [LOGO DATA] [ETX]

NAME

RASTERS
DROPS
DATA

LLOGO1 16001FFFF

Packet Type:
Set Module Width (B)
Set the module widths (bars and gaps) for printing
barcodes, to ensure that barcodes are readable regardless
of the ink spread on the substrate.
[STX] [TYPE] [BW1] [BW2] [BW3] [BW4]
[GW1] [GW2] [GW3] [GW4][ETX]
GW4
BW2
BW4
GW2
BW1
BW3
GW1
GW3

B1214162202030508

Packet Type:
Request Part Number (H)
Return the Software Part Number string
stored within the machine.
[STX] [TYPE] [ETX]

H
The machine responds with the
following packet:
[STX] [PART NUMBER] [ETX]

Packet Type:
Start Jet (J)
Starts the jet as if F1 has been pressed on the
keypad in the Quick Screen, or the user has
selected Start Jet from the System menu.
[STX] [TYPE] [ETX]

Packet Type:
Stop Jet (K)
Stops the jet as if F1 has been pressed on the
keypad in the Quick Screen, or the user has selected
Clean Stop Jet from the System menu.
[STX] [TYPE] [ETX]

Packet Type:
Return Error Status (E)
Returns the Error Status Word and the Alarm
Status Nibble.
[STX] [TYPE] [ETX]

E
The machine responds with the
following packet:
[STX] [ERROR WORD] [ALARM NIBBLE] [ETX]

Das könnte Ihnen auch gefallen