Driver Settings

<< Click to Display Table of Contents >>

 

Driver Settings

The examples in this section refer only to the use of ZPL II language, but using EPL II language is analogous.

To use this Driver, users must create a configuration file in ZPL II (Zebra Programming Language II) format containing the description of the labels to print. To create this file, open this Driver's Extra settings window, Other Parameters in E3 or in Elipse Power, and click the ZebraZPLII tab.

Each label must start with the keyword [BEGIN] and end with the keyword [END]. Inside these blocks, defined by these two keywords, there must be a user-created ZPL II program describing the label to generate.

Users can create variables identified by tokens, which are replaced during the printing process. A token is composed by &n, where n is a positive integer, such as &0, &1, or &2. These variables can be defined in an E3 or Elipse Power application using a PLC Tag with its N1 parameter equal to 0 (zero), as described later in this manual, and can contain numbers and also Strings.

To insert comments in ZPL code, use the expression "//" (double slash marks), which considers as a comment the rest of the line.

The next example was copied from ZPL II Language Programming Guide.

//Label 0:
[BEGIN]
^XA
//^XA – Indicates the start of label formatting
^LH&0,&1
//^LH – Sets label's initial position to
//&0 dots to the right and &1 dots starting
//from label's top edge
//(&0 and &1 are variables defined in the application at printing time)
^FO&2,&3^AD^FDZEBRA^FS
//^FO&2,&3 - Set field's origin to
//&2 dots to the right and &3 dots down starting
//from initial position (defined by the ^LH instruction)
//(&2 and &3 are variables)
//^AD - Selects a "D" font
//^FD - Start of field data
//ZEBRA - Actual field data (the word "ZEBRA")
//^FS - End of field data
^FO&4,&5^B3^FDAAA001^FS
//^FO&4,&5 - Sets field origin to
//&4 dots to the right and &5 dots down
//from the initial position (defined by the ^LH instruction)
//(&4 and &5 are variables)
//^B3 - Selects the bar code font "Code 39"
//^FD - Start of field data for the bar code
//AAA001 - Actual field data ("AAA001")
//^FS - End of field data
^XZ
//^XZ - Indicates end of label formatting
[END]

 

In the previous example, only the characters without the initial expression "//" are sent to the printer. All tokens beginning with "&" are replaced by one of this Driver's internal variables, from 0 (zero) to 50, which can be read and written with PLC Tags with their N1 parameter equal to 0 (zero). The initial value, before any operation, of all variables is equal to -1 (minus one), so users must initialize a variable whenever needed.

Several labels can be defined in the same file. The order each label appears in this configuration file is used to select it when printing, by using the N2 parameter of a PLC Tag with its N1 parameter equal to 1 (one), starting with 0 (zero), that is, the first label is 0 (zero), the second label is 1 (one), and so on.

This Driver, when loaded in a new project, is already pre-configured with the following parameters:

Serial port: Com1

Baud rate: 9600bps

Data bits: 7 (seven)

Stop bits: 2 (two)

Parity: Even

Timeout: 1000ms

 

To edit these settings, as well as for other settings, use this Driver's extra parameters window. The available options on this window are described on topic Documentation of I/O Interfaces.

Was this page useful?