NGPCL Users Guide v25

Download as pdf or txt
Download as pdf or txt
You are on page 1of 42

NGPCL Usage Guide

Document Author:
Name Position

Simon Starkey Senior Software Engineer

Approved By:
Name Position Signature Date

Markem Technologies Limited, Nottingham Science & Technology Park, University Boulevard,
Nottingham NG7 2RF.

The information contained herein is confidential and the properties of Markem Technologies Limited
and is supplied without liability for errors or omissions. No part may be reproduced or used except as
authorised by contract or other written permission. The copyright and the foregoing reproduction
restriction extend to all media in which the information in this document may be embodied.
Document History

Version Date Author Description


0.1 21 September 2003 Simon Starkey First draft issue.
0.2 10 November 2003 Simon Starkey Revise message identifiers
0.3 01 December 2003 Simon Starkey Job Request and allocation support
0.4 18 December 2003 James Cupit Add Data Source restrictions
0.5 09 January 2004 Simon Starkey Moved over from SD5
0.6 15 January 2004 Simon Starkey Rework following review meeting
0.7 26 January 2004 Simon Starkey Add Multi head work
0.8 11 February 2004 Simon Starkey Add PackML mode
0.9 23 February 2004 Simon Starkey Add details for no fields
1.0 02 March 2004 Simon Starkey Add release to version
1.1 04 March 2004 Simon Starkey Minor corrections
1.2 05 April 2004 Simon Starkey Remove legacy commands
1.3 18 May 2004 Simon Starkey Remove settings restrictions
Add user commands (version in line with
11 24 May 2004 Simon Starkey
Synergy)
12 20 September James Cupit Modified for external publication.
Minor Corrections. Extra details on Print
13 25 May 2005 Simon Starkey
Status request. Add pages to index table.
Message Padding now spaces.
Allow multiple fields request
14 7 December 2005 Simon Starkey
Allow the Request responses to have a
success field
Remove message concatenation
Add NAK response
15 05 January 2006 Simon Starkey
Add Check field
Add additional packet delimiters.
16 18 May 2006 Simon Starkey Change virtual I/O from 8 to 10
17 10 July 2006 Simon Starkey Change ‘success’ field to ‘status’ field
Removed SD5 references where
Mike
18 31 Oct 2009 applicable. USPD#3019 to update bit 6 of
MacDonald
device status
Add Protocol Version request and response
19 8 March 2010 Brad Tetu
to support Parent/Child connection.
Add File Transfer command to support
20 11 March 2010 Brad Tetu
Parent/Child connection.
Removed additional counts from Counts
21 24 Aug 2010 Jason Nichols Values Response in the 5600/5800 specific
commands section.

Page 2 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
Merged NGPCL Product Functional
22 03 Jan 2011 Jason Nichols
Specification with NGPCL Usage Guide
Added Remote Purge to Adopter specific
23 13 Jan 2011 Jason Nichols
commands.
Added Clear Print Queue to Adopter
24 06 Jul. 2012 Jason Nichols
specific commands
Clarification added that File transfer and
job preview are 5800 specific commands.
25 15 Oct 2014 James Cupit Also state change command was clarified
to state for SD only PRODUCING, READY
and HELD are target states.

Circulation List
Name Position

Master Document Location:


This document is currently located under:
Subversion in the ‘schema’ database. (e.g. http://keeneeng1/svn/schema/trunk)
Path : schema/trunk/protocol documentation/public

Page 3 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
Table of Contents
1 Introduction .................................................................................................................................. 6
1.1 Document Standards ............................................................................................................ 6
2 Design Principles ......................................................................................................................... 7
3 Physical Layer ............................................................................................................................. 8
3.1 RS232 .................................................................................................................................. 8
3.2 Ethernet ................................................................................................................................ 8
4 Protocol Structure ........................................................................................................................ 9
4.1 Message Security ............................................................................................................... 10
4.2 Field Length ........................................................................................................................ 10
4.3 Unicode .............................................................................................................................. 10
4.4 Message Types................................................................................................................... 11
4.4.1 Command .................................................................................................................... 11
4.4.2 Request ....................................................................................................................... 11
4.4.3 Response ..................................................................................................................... 11
4.5 Line Reference ................................................................................................................... 11
5 Message Definitions................................................................................................................... 12
5.1 NAK .................................................................................................................................... 12
5.2 Job Select ........................................................................................................................... 12
5.3 Job Request........................................................................................................................ 13
5.4 Job Name ........................................................................................................................... 13
5.5 Job Update ......................................................................................................................... 13
5.6 Field Contents Request ....................................................................................................... 15
5.7 Field Contents..................................................................................................................... 16
5.8 Logged Field Contents Request .......................................................................................... 16
5.9 Logged Field Contents ........................................................................................................ 17
5.10 Device Status Request .................................................................................................... 17
5.11 Device Status .................................................................................................................. 18
5.12 Clear to Send Data Request ............................................................................................ 18
5.13 Clear to Send Data Response.......................................................................................... 19
5.14 Counts Request ............................................................................................................... 19
5.15 Counts Values ................................................................................................................. 19
5.16 Setting Change................................................................................................................ 20
5.17 Setting Request ............................................................................................................... 20
5.18 Setting Value ................................................................................................................... 21
5.19 Print Request................................................................................................................... 21
5.20 Print Status Request ........................................................................................................ 21
5.21 Print Status Response ..................................................................................................... 22
5.22 State Change .................................................................................................................. 22
Page 4 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
5.23 Virtual Output Request .................................................................................................... 22
5.24 Virtual Outputs ................................................................................................................ 23
5.25 Set Virtual Input ............................................................................................................... 24
5.26 Request Clock ................................................................................................................. 24
5.27 Current Clock .................................................................................................................. 24
5.28 Clock Set ......................................................................................................................... 24
5.29 Version Request .............................................................................................................. 25
5.30 Version Response ........................................................................................................... 25
5.31 Allocation Clear ............................................................................................................... 25
5.32 Protocol Version Request ................................................................................................ 26
5.33 Protocol Version Response.............................................................................................. 26
5.34 File Transfer Command ................................................................................................... 26
5.35 Job Preview Request ....................................................................................................... 27
5.36 Job Preview Response .................................................................................................... 27
5.37 User Request................................................................................................................... 28
5.38 User Data ........................................................................................................................ 28
5.39 User Command ............................................................................................................... 28
6 PackML Codes........................................................................................................................... 29
7 Worked Checkfield Example ...................................................................................................... 30
8 Summary of Message Identifiers ................................................................................................ 31
9 NGPCL System Integration Scenarios ....................................................................................... 33
9.1 Full NGPCL Control ............................................................................................................ 33
9.2 NGPCL Line Control with Flexible IO Print-Go .................................................................... 34
10 Check Weigh Applications using NGPCL................................................................................ 37
10.1 Printer Settings. ............................................................................................................... 37
10.2 NGPCL Image While Printing Print Cycle ........................................................................ 38
10.3 NGPCL Image While Printing Print Cycle Commands Example ....................................... 39
10.4 NextGen PCL / Legacy PCL Compatibility. ...................................................................... 40
11 Adopter specific commands.................................................................................................... 41
11.1 5600/5800 specific commands ........................................................................................ 41
11.1.1 Counts Values.............................................................................................................. 41
11.1.2 Remote Purge.............................................................................................................. 41
11.1.3 Clear Print Queue ........................................................................................................ 42

Page 5 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
1 Introduction
This document describes the NGPCL language that is uses to connect a NextGen based printer to
simple line control equipment. This equipment is typically PLC based and is not capable of handling
the more complex DCP protocol used by the links to the SmartTouch and the HostPC.
NGPCL is a Markem NextGen protocol that is not adopter specific. The first release of the design of
the protocol meets the requirements laid down in the ‘SmartDate5 Requirements Specification’.
Additional features may be added to support other adopters.
NGPCL has evolved from the ASCII comms protocol currently in use on the SmartDate 2/3.
NGPCL shall contain a limited number of commands using the same format as the existing
SmartDate 2/3 to allow existing users an easier upgrade path. These commands compromise the
functionality of the NextGen device and new users should be encouraged to use the new commands.
For details see ngpcl_legacy_pfs.doc.

1.1 Document Standards


ASCII/Unicode characters are denoted using single quotes. For example ‘A’ denotes the
ASCII/Unicode character A which has the decimal value 65.
The NULL character (transmitted as the value 0) is denoted using ‘\0’.

Page 6 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
2 Design Principles
The following design principles are to be adopted.
 All commands to the printer (NGE device) shall not require the control system to process a
reply although a reply will be sent to allow secure processing.
 Fields within the NGPCL protocol shall be of a fixed field size wherever possible from the
NGE device since PLCs have difficulty understanding variable length field messages.
 NGPCL shall be designed to work over slower RS232 links (typically 9600 baud).
 The messages shall be simple for the control equipment to generate and for the control
equipment to decode. This shall take precedence over making the commands compact and
easy to generate for the NGE device.
 Only one NGPCL link shall be available at any one NGE device.
 All NGPCL ‘conversations’ shall be initiated by the external control equipment.

Page 7 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
3 Physical Layer
NGPCL may use either RS232 links or Ethernet links

3.1 RS232
RS232 shall be used without any handshaking (hardware or software).
The UART shall be configured to 8 data bits, 1 stop bit and no parity.
Baud rate shall be configurable, but shall be the same for both transmit and receive.

3.2 Ethernet
Both NextGen device and remote controller shall have a configurable fixed IP address.
NGPCL shall always use port 21,000.
Note, when using a fixed IP address the NG device will not be able to communicate with a
SmartTouch.

Page 8 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
4 Protocol Structure
All messages, both to the NGE device and to the control system, shall have the following structure:

Packet Message Message Message Body (optional) Packet


Start Number Identifier End

The ‘Packet Start’ shall be a unique ASCII control character unused elsewhere in the protocol.
The ‘Packet End’ shall be a unique ASCII control character unused elsewhere in the protocol.
The Message Number is an optional fixed length field. It may be logged by the NGE device and used
to track job selects. It shall be 4 numeric characters. If it is included in a message to an NGE device
it shall be sent in the response to that message.
The ‘Message Identifier’ shall be a fixed length, (3-character) sequence. The sequence shall always
start with the same Message Identifier character.
The size of the Message Body shall be dictated according to message type (as denoted by the
Identifier). A command message does not always require a Message Body. A Response or Reply
message shall always have a body.
A packet shall only contain one message.
The Message Identifier and the Message Body may be repeated between Packet Start and Packet
End in messages sent to the NG Device as shown in the diagram below:

Packet Message Message Message Body (optional) Message Message Body (optional) Packet
Start Number Identifier Identifier End

Within a message body fields will be separated by the delimiter character. The delimiter must not
appear within message body fields. A delimiter character appears at the end of each message body.
All fixed length numeric fields sent from the NG device shall be padded by inserting leading zeros.
Numeric strings received by the NG device may be padded using leading zeros, leading spaces,
training spaces or trailing nulls. The example below shows the value 100 being sent as a fixed length
9-character string:
‘0’ ‘0’ ‘0’ ‘0’ ‘0’ ‘0’ ‘1’ ‘0’ ‘0’
‘‘ ‘‘ ‘‘ ‘‘ ‘‘ ‘‘ ‘1’ ‘0’ ‘0’
‘1’ ‘0’ ‘0’ ‘‘ ‘‘ ‘‘ ‘‘ ‘‘ ‘‘
‘1’ ‘0’ ‘0’ ‘\0’ ‘\0’ ‘\0’ ‘\0’ ‘\0’ ‘\0’

The following control characters are defined:

Preferred Values
Legacy values
Printable (default) Traditional
Control Character
Decimal
Decimal ASCII Decimal ASCII
ASCII Value Equivalen
Equivalent Value Equivalent Value
t
Packet Start { 123 STX 2 ^A 1
Delimiter | 124 | 124 | 124
Message Start ~ 126 ~ 126 ^ 136
CheckField Start | 124 | 124 - -
Packet End } 125 ETX 3 ^Z 26

Page 9 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
Three sets of control characters are defined. ‘Preferred’ values are to be used for all new installations,
while ‘Legacy’ values allow NextGen devices to work in older installations. Within the Preferred
section, two sets of packet delimiters are defined. The Printable set (curly brackets) is used when the
protocol needs to be viewed/simulated using a standard Windows terminal emulator (e.g.
HyperTerminal). The Traditional set (STX/ETX) can be used where link security is the overriding
requirement, as these characters are less likely to be accidentally included in a field’s text, or
elsewhere in the message.
The NextGen device will support a setting allowing the user to select the ‘Preferred’ control character
set used. This setting shall default to the Printable setting. The NG device shall always respond using
the same control characters as those in the initiating message, as set via the device setting.
The ‘Legacy’ control characters may only be used in conjunction with the Legacy commands. The NG
device shall respond using the same control characters as those in the initiating message.
It is the user’s responsibility to ensure the control characters are not used within the image design.
The control characters have been chosen to minimise this occurrence.
The Checkfield is optional. The Checkfield consists of a ‘Checkfield Start’ character followed by a
fixed length numeric field, 3 digits long. The Checkfield is calculated on the characters between (but
not including) the Packet Start and the Checkfield Start. The NextGen device will support a setting
allowing the user to enable the checkfield. Once enabled the checkfield must be included in every
message received by the NextGen device and the device will include the Checkfield in all messages it
sends.
The Checkfield is calculated by summing the decimal values of each ASCII character to be checked
and taking the mod 1000 of the result. If the resulting value is less than 3 digits then it is padded to 3
digits using leading zeros. A worked example can be found in section 7.

4.1 Message Security


The application receiving the message shall successfully parse the complete message and validate
any checkfield before any data within the message is actioned. If either the parsing or the checkfield
fails the receiving application shall respond with the NAK message.

4.2 Field Length


PLCs have difficulty handling variable field lengths. The NextGen IDM model does not limit the
length of job names, field names and field values. The user is at liberty to apply their own limit to field
length at image design time. To allow fixed length fields to be sent to the NextGen device the
sending device may pad strings by appending null (decimal value 0) characters to strings shorter than
the fixed size. The NextGen device will strip off these padding characters.
The NG device can be programmed to force field strings to fixed lengths. Two machine settings are
required to specify Field Name length and Field Value length. If the setting is 0 then the field value is
sent as a variable length value. If the setting is non-zero then the field is forced to the required
length. If the field is longer than the setting it is truncated. If the field is shorter than the setting then it
is padded up to the correct length using null characters.

4.3 Unicode
To use the full NextGen feature set the control system must support Unicode. However PLC systems
may not support Unicode, or the application may not require Unicode. A machine setting will control
the use of Unicode.
If Unicode is enabled all received and transmitted characters on the NGPCL link will be sent as 16 bit
Unicode characters.
If Unicode is disabled all data shall be sent and received as 8 bit ASCII characters. The user should
ensure that their images and jobs do not require use of the full Unicode character set.
Page 10 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
4.4 Message Types
4.4.1 Command
A Command is sent to the NG device to instruct it to take an action.
The NG device shall respond to a Command by returning the message identifier.
The NG device can be instructed (as part of the command) to delay the reply until the action has
completed (or failed to complete). If the NG device receives another NGPCL message before it has
replied it will cancel the pending reply.
The reply shall always have a single character success code that shall be ‘0’ for success and ‘1’ for
command failed.
4.4.2 Request
A Request is sent to the NG device to ask for information. It will not initiate an action. A Request
always expects a Response.
4.4.3 Response
A Response is sent by the NG device following a Request.
Optionally a response shall have a single character status code that shall be ‘0’ for success and ‘1’ for
response failed. A setting allows this feature to be turned on or off for all responses. The default is
controlled by the NG adopter. The recommendation is for this setting to default to ‘on’.
Note
There are no unsolicited responses sent by the NG device.

4.5 Line Reference


NextGen devices with multiple print heads may have more than one job. Heads may be grouped and
jobs assigned to the head groups. A group of heads will be referred to by a unique identifier string
known as the ‘Line Reference’. Line reference strings are configured within the NextGen device.
Line Reference strings appear as elements within commands. The NextGen device will only reply if
the element matches a valid group of heads. For single head machines the Line Reference element
will be blank (a zero length string). The element may not be omitted.

Page 11 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
5 Message Definitions
The following message are defined:

5.1 NAK
Sent to or from the NGE device in following the failure of any packet to be correctly parsed or if the
checkfield is incorrect

Response Field Field Length Notes


Message Identifier ~NK
Message Body Status 1 character Optional

The Status field will always have the value 1 indicating failure.
Example
~NK1|

5.2 Job Select


Sent to the NGE device to select a job

Command Field Field Length Notes


Message Identifier ~JS
0 – Reply immediately
Reply Timing 1 character
1 – Reply when job imaged
Job Name Variable
Message Body Allocation Variable, 0 = no allocation
max 9
characters
Variable Field Name Variable May be repeated. Must be sent as a
Variable Field Data Variable pair.

The Reply Timing and Job Name fields are compulsory.


Subsequent fields are optional, however if an optional field is included all preceding fields must be
included.
Example
~JS0|Job1|1|Field1|Field1Value|
Command Reply:
~JS0|
Notes: There is no restriction on the order of variable fields.
If any setting changes need to be associated with the job selection they can either be set up as part of
the job or sent as an additional change setting command after the Select Job command.

Page 12 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
5.3 Job Request
Sent to the NGE device to request the current job(s).

Request Field Field Length Notes


Message Identifier ~JR
Message Body Line Reference Variable Blank if single head

The job is reported on a per Line Reference basis. For NG devices with only one head the field may
be left blank. It must not be omitted. For NG devices with multiple heads the Line Reference must be
valid or the request will fail.
Example
~JR|
This example shows a blank Line Reference.

5.4 Job Name


Sent by the NGE device in response to a Job Request to report the Job Name.

Response Field Field Length Notes


Message Identifier ~JN
Status 1 character Optional
Message Body
Job Name Variable The name of the current job

If there is no currently selected job on the specified line then the job name shall be blank and the
‘status’ field (if enabled) shall have a value of 1.
Example
~JNCurrentJob|
~JN0|CurrentJob| (if ‘Status’ field enabled)

5.5 Job Update


Sent to NGE device to update the currently selected job.

Command Field Field Length Notes


Message Identifier ~JU
0 – Reply immediately
Reply Timing 1 character
1 – Reply when job imaged
Job Name Variable
Allocation Variable 0 = no allocation
Message Body
max 9
characters
Variable Field Name Variable May be repeated. Must be sent as a
Variable Field Data Variable pair.

The Job Name field may be left blank when sent to NG devices that only support a single job.

Page 13 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
The ‘Field Name’ and ‘Field Data’ fields are treated as a pair repeated a number of times.

Page 14 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
Example
~JU0||001|Field1|Field1Value|
Command reply:
~JU0|
Only alphanumeric fields can be updated in using this message. The form of data source it internally
uses also determines whether or not an alphanumeric field can be updated. The following rules apply:

Updateable
Data Source Syntax / data constraints
via NGPCL?
Static No N/A
UserInput Yes The field data must match the data validation mask
defined by the image designer.
Merged No N/A
Calculated Yes The value must be between the minimum and
maximum values specified by the image designer
range limits
MachineSetting No 1 N/A.
UserPromptedDate Yes The field data must be a date formatted as
YYYYMMDD. The date defined must be valid. If
the range limits are defined by the image designer,
then the date must fall within them.
TimeDate without OffsetRule No N/A
TimeDate with OffsetRule Yes The field data must be an offset formatted as
DDD/MM/YY. If range limits are defined, the offset
must fall within them
CalendarMaintainedDate No N/A
Note 1 - Also note that any changes to a setting will not be printed until a new job is selected.

5.6 Field Contents Request


Sent to NGE device to request the current value of a single field.

Request Field Field Length Notes


Message Identifier ~FR
Job Name Variable
Message Body
Field Name Variable

The Job Name field may be left blank when sent to NG devices that only support a single job.
Example
~FR|Field1|
Note the blank job name field in the example.
If the Field Name is blank then the NG device will report all the fields within the specified job

Page 15 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
Example
~FR|| All fields from currently selected job
~FRJob1|| All fields from Job1

5.7 Field Contents


Sent by NGE device in response to a Field Contents Request.

Response Field Field Length Notes


Message Identifier ~FC
Status 1 character Optional
Message Body Field Name See section 4.2
Field Data See section 4.2

Only one field is returned in this response. If the job name in the request is specified and does not
match a selected job, or the field name in the request does not match a field name in the selected job
then this message consists of a blank field name only.
Example:
~FCField1Name|Field1Value|
~FC0|Field1Name|Field1Value| (if ‘Status’ field enabled)
If the requested field does not exist the message will be:
~FC|
~FC1| (if ‘Status’ field enabled)
If the request specifies multiple fields the Field Name and Field Data fields are repeated as
necessary.
~FCField1Name|Field1Value|Field2Name|Field2Value|
Note: For data from more than one field the user should use the logged field contents request or
create a hidden merged field in the image and request that field.

5.8 Logged Field Contents Request


Sent to NGE device to request the current value of all fields marked for logging.

Request Field Field Length Notes


Message Identifier ~FL
Message Body Job Name Variable

The Job Name field may be left blank when sent to NG devices that only support a single job.
Example
~FL|
Note the blank job name field in the example.

Page 16 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
5.9 Logged Field Contents
Sent by NGE device in response to a Request Field.

Response Field Field Length Notes


Message Identifier ~FV
Status 1 character Optional
Message Body Field Name See section 4.2 Sent as a pair. One pair for each
Field Data See section 4.2 field marked for logging.

If there are not fields defied for logging in the requested job, or the requested job is not selected then
a reply with a blank field name shall be sent.
Example:
~FVField1|Field1Value| Field3|Field3Value|
~FV0|Field1|Field1Value| Field3|Field3Value| (if ‘Status’ field enabled)
If there are no logged fields the message will be:
~FV|
~FV1| (if ‘Status’ field enabled)

5.10 Device Status Request


Sent to the NGE device to request it to report the machine status

Request Field Field Length Notes


Message Identifier ~DR
Message Body Line Reference Variable Blank if single head

The status is reported on a per Line Reference basis. For NG devices with only one head the field
may be left blank. It must not be omitted. For NG devices with multi heads the Line Reference must
be valid or the request will fail.
Example
~DR|
The Line Reference in this example is blank, indicating a single head machine.

Page 17 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
5.11 Device Status
Sent by the NGE device in response to a status request. Note all the values are specific to the Line
Reference requested.

Response Field Field Length Notes


Message Identifier ~DS
Status 1 character Optional
NGE device in producing 1 character ‘1’ = producing, ‘0’ otherwise
state
NGE device in aborted 1 character ‘1’ = aborted, ‘0’ otherwise
state
NGE device warning 1 character ‘1’ = warning active, ‘0’ otherwise
active
NGE device imaging 1 character ‘1’ = image complete (reset to ‘0’ by
complete print go).
Result of last job select 1 character 0 = no select received
Message Body or job update 1 = processing
2 = complete and successful
3 = failed – allocation in progress
4 = failed – file missing
Allocation in progress 1 character ‘1’ = allocation in progress, ‘0’
otherwise
Allocation remaining 9 characters Set to 000000000 if no allocation.
NGE device PackML
2 characters See section 6
state
NGE device PackML
1 character See section 6
mode
Those settings above this line are standard to the NextGen core, those below are NextGen adopter
specific. The Next Gen adopter is free to lengthen the message to add extra data. The Next Gen
adopter is responsible for defining the extra data added.
Adopter Data

Example:
~DS1|0|0|0|0|1|000000005|06|1|
~DS0|1|0|0|0|0|1|000000005|06|1| (if ‘Status’ field enabled)

5.12 Clear to Send Data Request


Sent to NGE device to request whether the last job selection or update has been printed (or started
printing). It can be used to find out when the NG device is ready to accept the next Job Select or Job
Update.

Page 18 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
Request Field Field Length Notes
Message Identifier ~DC
0 – Respond immediately
Message Body Response Timing 1 character
1 – Respond when clear to send data

Example
~DC0|

5.13 Clear to Send Data Response


Sent by NGE device in response to a Clear to Send Data Request.

Request Field Field Length Notes


Message Identifier ~DV
Status 1 character Optional
Message Body 0 – Ready to accept new data
Clear to Send status 1 character
1 – Not ready to accept new data

Example
~DV1|
~DV0|1| (if ‘Status’ field enabled)
Note: If the NextGen device is not in the Producing state this response will be returned immediately
(whatever the value of the ‘Response Timing’ field in the request) and report ‘Not Ready’.

5.14 Counts Request


Sent to NGE device to request the current counts values.

Request Field Field Length Notes


Message Identifier ~CR
Message Body Line Reference Variable Blank if single head

The counts is reported on a per Line Reference basis. For NG devices with only one head the Line
Reference field may be left blank. It must not be omitted. For NG devices with multi heads the Line
Reference must be valid or the request will fail.
Example
~CR|
The Line Reference in this example is blank indicating it comes from a single head device.

5.15 Counts Values


Sent by NGE device in response to a ‘Request Counts’ message

Response Field Field Length Notes


Message Identifier ~CV
Message Body Status 1 character Optional

Page 19 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
Count Type 5 Characters A code defining the count type
Count Value 9 Characters

Count Type and Value will be repeated within the message body.
Example
~CVTOTAL|000000000|BATCH|000000000|
~CV0|TOTAL|000000000|BATCH|000000000| (if ‘Status’ field enabled)
The number of counts reported will be defined by the adopter project. The NextGen core defines the
following counts that shall always be sent (in this order first):

Count Count type code


Total Print Count TOTAL
Batch Print BATCH
Count

5.16 Setting Change


Sent to NGE device to change the value of a single setting. The requirements outlined in the
NGCommon requirements spec ‘Print Job Management’ shall apply. The requirements specify the
settings that can be changed in each PackML state. This can lead to changes in settings being
rejected. If a setting change is rejected the command will fail.

Command Field Field Length Notes


Message Identifier ~SC
Setting Name Variable As defined in printer settings file
Message Body
Setting Value Variable

Example
~SCdarkness|90|
The new settings value (if valid) will take effect as soon as possible before the next print. It will not
change settings during a print.

5.17 Setting Request


Set to NGE device to request a setting value.

Request Field Field Length Notes


Message Identifier ~SR
Message Body Setting Name Variable As defined in printer settings file

Example
~SRdarkness|

Page 20 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
5.18 Setting Value
Sent by NGE device in response to a Request Settings message.

Request Field Field Length Notes


Message Identifier ~SV
Status 1 character Optional
Message Body Setting Name Variable As defined in printer settings file
Setting Value Variable As defined in printer settings file

Example
~SVdarkness|90|
~SV0|darkness|90| (if ‘Status’ field enabled.

5.19 Print Request


Sent to NGE device to request a print action

Command Field Field Length Notes


Message Identifier ~PG
Line Reference Variable Blank if single head
Action 1 character 0 – Print
1 – Print & Apply
Message Body 2 – Apply only
Reply Timing 1 character 0 – Reply immediately
1 – Reply when action started
2 – Reply when action complete

Example
~PG|0|0|
Command Reply:
~PG0|

5.20 Print Status Request


Sent to NGE device to determine if device is ready to print

Request Field Field Length Notes


Message Identifier ~PS
Line Reference Variable Blank if single head
Message Body 0 – Reply immediately
Reply Timing 1 character
1 – Reply when ready to print

Example
~PS|0|
Note: Ready to print is defined as device in ‘producing’ state and any imaging is complete.

Page 21 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
If the NG Device is not in the ‘Producing’ state the request will get an immediate response since the
controlling application will never otherwise get a reply.

5.21 Print Status Response


Sent by NGE device to report if device head is ready to print

Response Field Field Length Notes


Message Identifier ~PR
Status 1 character Optional
0 – Ready to print
Message Body 1 – Unable to print, incorrect state
Print Status 1 character
2 – Unable to print, printing
3 – Unable to print, fault

Example
~PR0|
~PR0|0| (if ‘Status’ field enabled)

5.22 State Change


Sent to NGE device to request a state change

Command Field Field Length Notes


Message Identifier ~ST
Line Reference Variable Blank if single head
Message Body
New State 2 character See section 0.

Example
~ST|04|
The NGE device will transition to the new state (if permitted) using the PackML state model. The
intervening states will not be reported via this link. The success or failure of this command can be
determined from the device status.

Note – for SmartDate: only the READY, PRODUCING and HELD states can be targeted by this
operation.

5.23 Virtual Output Request


Sent to NGE device to request the state of the virtual Outputs

Command Field Field Length Notes


Message Identifier ~OR
Message Body None

Example
~OR

Page 22 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
5.24 Virtual Outputs
Sent by NGE device to report the state of the virtual Outputs

Command Field Field Length Notes


Message Identifier ~OV
Status 1 character Optional
Message Body Virtual Outputs 10 characters 10 Virtual Outputs arranged as
binary. Virtual output 1 sent first

Example
~OV0000000001| ( Shows output 10 active, 1-9 inactive)
~OV0|0000000001| (if ‘Status’ field enabled)

Page 23 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
5.25 Set Virtual Input
Sent to NGE device to set the virtual input states used by flexible mapping. NGPCL supports eight
virtual inputs.

Command Field Field Length Notes


Message Identifier ~SI
8 virtual inputs Binary format. Virtual
input 1 sent first
Message Body New Control 8 characters 0 – Clear virtual input,
1 – Set virtual input,
X – leave unchanged

Example
~SI0000001X|
This command clears virtual inputs 1 – 6, sets virtual input 7 and leaves virtual input 8
unchanged.

5.26 Request Clock


Sent to NGE device to request current clock values

Request Field Field Length Notes


Message Identifier ~RC
Message Body None

Example
~RC

5.27 Current Clock


Sent by NGE device in response to a Request Clock

Response Field Field Length Notes


Message Identifier ~CC
Status 1 character Optional
Message Body
Clock value 19 characters hh:mm:ss dd/mm/yyyy

Example
~CC10:25:40 04/12/2003|
~CC0|10:25:40 04/12/2003| (if ‘Status’ field enabled)

5.28 Clock Set


Sent to NGE device to adjust Clock

Command Field Field Length Notes


Message Identifier ~CS

Page 24 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
Message Body Clock value 19 characters hh:mm:ss dd/mm/yyyy

Example
~CS10:25:40 04/12/2003|

5.29 Version Request


Sent to NGE device to request NGE Device Firmware version

Request Field Field Length Notes


Message Identifier ~VR
Message Body None

Example
~VR

5.30 Version Response


Sent by NGE device in response to a Request Version

Response Field Field Length Notes


Message Identifier ~VV
Status 1 character Optional
Program Major Version 3 characters
Message Body
Program Minor Version 3 characters
Program Release 3 characters

The adopter may define and add extra version information to this message.
Example:
~VV001|001|001|
~VV0|001|001|001| (if ‘Status’ field enabled)

5.31 Allocation Clear


Sent to NGE device to request the clearance of an allocation

Command Field Field Length Notes


Message Identifier ~AC
Message Body Job Name Variable

The Job Name field may be left blank when sent to NG devices that only support a single job.
Example:
~AC|
Note: If the user does not want the NG device to start printing immediately upon receipt of this
command they should move the device out of the ‘Producing State’ using the ‘State Change’
Command

Page 25 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
5.32 Protocol Version Request
Sent to the NGE device to request the version of NGPCL supported. Request added to support
requirements for Parent/Child controller connection.

Request Field Field Length Notes


Message Identifier ~PV
Message Body None

5.33 Protocol Version Response


Sent by NGE device to indicate the version of NGPCL supported.

Request Field Field Length Notes


Message Identifier ~VP
Status 1 character Optional
Message Body
Version String Variable

Example:
Request: ~PV|
Response: ~VP2.0|
~VP0|2.0| (with optional status field)

5.34 File Transfer Command (5800 only)


Sent to the NGE device. Indicates that impending file transfer will occur. Specifies the name of the file
being transferred as well as the number of data packets that will need to be received and processed.
Optionally the sender can send the mod1000 checksum of the file contents, to be verified by the
receiver once the final data packet is received. Multiple concurrent file transfers are not supported
over one NGPCL link.

Request Field Field Length Notes


Message Identifier ~FT
File name variable Includes extension
Packets Variable The number of File Data packets to
send complete base64 encoded file.
Message Body
File Checksum 3 characters A mod1000 checksum of the
contents of the file being transferred.
Optional. Not implemented.

Page 26 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
Sent to the NGE device. A file transfer will be broken up into multiple smaller packets, containing at
most 1024 bytes of raw file data. The file data will be base64 encoded. Optionally each packet can be
numbered for added data integrity.

Request Field Field Length Notes


Message Identifier ~FD
Data Length variable Length of base64 encoded data in
characters
Data Variable File data base64 encoded
Message Body
Packet Number variable Index used to ensure the order of the
packets. Optional. Not
Implemented.

Example without packet numbers:


Request: ~FTmyTestFile.bmp|1|
Response: ~FT0|

Request: ~FD1024|<FileData>|
Response: ~FD0|
Example with packet numbers:

5.35 Job Preview Request (5800 only)


Sent to the NGE device to request a preview of the currently selected job.

Request Field Field Length Notes


Message Identifier ~JP
Message Body None

5.36 Job Preview Response


Sent by the NGE device in response to a preview request of the currently selected job.

Request Field Field Length Notes


Message Identifier ~PJ
Success Code 1 Character
Width Variable Width of the preview bitmap in pixels
Message Body Height Variable Height of the preview bitmap in
pixels
Preview Data Variable Preview data base64 encoded

Page 27 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
5.37 User Request
Sent to NGE device to request ‘User Data’.

Request Field Field Length Notes


Message Identifier ~UR
Message Body None

5.38 User Data


Sent by NGE device in response to ‘User Request’.

Request Field Field Length Notes


Message Identifier ~UD
Status 1 character Optional
Message Body
Defined by user Variable See adopter’s manual

This message provides a mechanism for the adopter to return data that is specific to the NextGen
adopter. The adopter must define the format of the data. E.g. SmartDate5 radial ribbon save data.

5.39 User Command


Sent to NGE device to perform a function particular to the adopter software.

Request Field Field Length Notes


Message Identifier ~UC
Defined by user Variable See adopter’s manual or Adopter
Message Body
specific commands in this document

This message provides a mechanism to send a command that is specific to the adopter. The adopter
must define the format of the message body. E.g. SmartDate5 radial ribbon save command.

Page 28 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
6 PackML Codes
The PackML states are represented using the codes defined in the PackML Tag Naming document
(V1.0) produced by the OMAC packaging workgroup.

Code used
PackML State
in NGPCL
Undefined 00
Off 01
Stopped 02
Starting 03
Ready 04
Standby 05
Producing 06
Stopping 07
Aborting 08
Aborted 09
Holding 10
Held 11

The PackML modes are represented using the codes defined in the PackML Tag Naming document
produced by the OMAC packaging workgroup.

Code used
PackML Mode
in NGPCL
Undefined 0
Automatic 1
Semi-
2
Automatic
Manual 3
Idle 4

Page 29 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
7 Worked Checkfield Example
This example shows the way a checkfield would be calculated in practise.
Refer back to section Error! Reference source not found. where message structure is defined.

For the purpose of this example take an example of the Job Select command.

~JS0|Job1|1| Field1|Field1Value|Field2|Field2Value|

Job Select is taken as the example here since it includes a variable number of arguments and thus
the example illustrates the correct message formatting.
The Checkfield is computed on the message before it is inserted into the packet.
Each character is converted to its corresponding decimal value. This is a standard program statement
in most programming languages, for example in Visual Basic statement Asc(“A”) returns the decimal
value 65.
Working through the message ‘~’ converts to 126, ‘J’ converts to 74 and so on the end of the string.
Summing these values gets the result 4760. Taking Mod 1000 of this value gives 760. Thus the
resulting packet is:

<STX>~JS0|Job1|1| Field1|Field1Value|Field2|Field2Value||760<ETX>

Where <STX> denotes the single Start of Transmission character and <ETX> the End of
Transmission character.
Note that mechanism is the same whether the character is normal ASCII or Unicode

Page 30 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
8 Summary of Message Identifiers
Sorted into alphabetic order.

Message
Function Type
Identifier
~AC Allocation Clear Command
~CC Current Clock Value Response
~CR Counts Request Request
~CS Clock Set Command
~CV Counts Values Response
~DC Clear to Send Data Request Request
~DR Device Status Request Request
~DS Device Status Response
~DV Clear to Send Data Response Response
~FC Field Contents Response
~FL Logged Fields Request Request
~FR Field Request Request
~FV Logged Field Contents Response
~JN Job Name Response
~JR Job Request Request
~JS Job Select Command
~JU Job Update Command
~NK NAK Response
~OR Virtual Output Request Request
~OV Virtual Outputs Response
~PG Print Go Command
~PR Print Status Response Response
~PS Print Status Request Request
~PV Protocol Version Request Request
~RC Request Clock Request
~SC Setting Change Command
~SI Set Virtual Input Command
~SR Setting Request Request
~ST State Change Command
~SV Setting Value Response
~UC User Command Command
~UD User Data Response

Page 31 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
~UR User Request Request
~VP Protocol Version Response Response
~VR Request Version Request
~VV Device Version Response

Page 32 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
9 NGPCL System Integration Scenarios
The following two integration scenarios show the communications between a NextGen printer and
other deployed components. The aim is to show how race conditions are avoided and maximum
machine efficiency is obtained via command sequences issued by a line controller using NGPCL.

9.1 Full NGPCL Control

Within this scenario, the line controller has full control over the printer. The line controller is
responsible for initiating job selection, providing field data on a per-print basis and initiating these
prints.

LineController Printer

PLC controlling job NGPCL/RS232


Requests job files from NGW,
selection, providing data to prints data and informs labeller
print and triggering prints of print cycle events

The sequence below shows the NGPCL communication between the line controller and printer to
select a job and initiate 2 prints.

Page 33 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
Line Controller Printer

NGPCL
JobSelect

PrepareImage
JobSelectReply

PrintRequest

PrintRequestReply

JobUpdate
Print

PrepareImage

JobUpdateReply
ReturnHeadToStart
PrintStatusRequest

PrintStatusReply

PrintRequest

PrintRequestReply

JobUpdate
Print()

Within the above sequence,

 JobSelect and JobUpdate commands are invoked with the reply timing Reply when job
imaged. No NGPCL communication therefore occurs until the internal action PrepareImage
has completed.
 The PrintStatusRequest command is invoked with the reply timing Reply when ready to print.
NGPCL communication thus blocks until the internal action ReturnHeadToStart has
completed.
 The PrintRequest command is invoked with the reply timing Reply when action started. This
allows JobUpdate commands to initiate imaging while printing.

9.2 NGPCL Line Control with Flexible IO Print-Go

This deployment scenario involves a line controller invoking jobs on the printer and supplying field
data on a per-print basis. The labeller is responsible for triggering prints. The printer (for example, a
SmartDate5) is configured to use NGW as its database.

Page 34 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
NGW
NGW provides a job management
service, which transfers the files
required to print a job to the
SmartDate5 on request.

DCP/ethernet

SmartDate5 Labeller
LineController
The labeller is responsible
The line controller The SmartDate5 uses NGW to for controlling the print
initiates job obtain files relevant to a job cycle by initiating print
NGPCL/RS232
selection and serves selected by the line controller. It Flexible IO signals and waiting for
the data to be responds to print signals from prints to complete.
printed within a the labeller.
given job.

The sequence below shows the communication between the line controller, printer, labeller and NGW
to select a job and initiate 2 prints
LineController SmartDate5 NGW Labeller

NGPCL DCP Flexible IO

JobSelect

RequestFile(job)
FileTransferResponse

RequestFile(image)

FileTransferResponse

RequestFile(settings)
FileTransferResponse

PrepareImage

ImagingComplete
JobSelectedEvent()
JobSelectReply
ClearToSendData

Print

ClearToSendDataReply
JobUpdate

Print
PrintComplete

PrepareImage ReturnHeadToStart
CycleComplete

ImagingComplete
JobUpdateReply
Print
ClearToSendData()

Within the above sequence

 JobSelect and JobUpdate commands are invoked with the reply timing Reply when job
imaged. No NGPCL communication therefore occurs until the internal action PrepareImage
has completed.
 The ClearToSendData command is invoked in order to determine when UpdateJob can be
invoked.
 ClearToSendDataReply is sent in response to ClearToSendData when printing the current
image buffer begins. This allows imaging while printing. NGPCL communication is blocked
between sending ClearToSendData and receipt of a print signal (via flexible IO).

Page 35 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
Page 36 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
10 Check Weigh Applications using NGPCL
Within a checkweigh applications the content of particular fields within the printed image will be
updated between each print. This means the image used must be designed to contain fields which
can be dynamically updated using NGPCL.
In order to support check-weigh applications, the image designer must select the user-input data
source for all fields requiring dynamic update. This supports updating the printed data to a new
Unicode text string while printing in the Producing mode via communication with an external
application.
The strings served by the application can be of any form (e.g. numeric, alphabet, alphanumeric,
empty). The image designer can, however, define constraints on the set of acceptable strings (e.g. a
4 digit number). When the image update takes place, data is validated against these constraints. If
it fails, then this failure is reported to the user.
The image designer must also ensure that all fields requiring dynamic update as part of the
application are given a unique name. This name is used to identify which fields require updating as
part of the update message.

10.1 Printer Settings.


In order to receive messages via NGPCL, including job update messages, the printer must be
configured appropriately. The following settings must be configured to the following values
Serial Port1 Function – NGPCL (RS232)
Serial Port1 Baud Rate – 57600 (or baud rate of controlling application)
Serial Port1 CharSet – Ascii (or Unicode if controlling application uses Unicode).
In addition, in order to trigger prints using NGPCL, the SD5 must be configured to use an external
print trigger.

Page 37 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
10.2 NGPCL Image While Printing Print Cycle
The NextGen PCL command set and protocol structure is fully documented in NextGen PCL product
functional specification. This section details how commands within this command set should be
sequenced to run a check-weigh application to obtain the maximum pack-rate. It is assumed that the
application is in full control of the print cycle. New field data is submitted and prints are initiated using
NGPCL; print trigger signals are received via an alternative external source.
The check-weigh print cycle is maximally efficient if the printer is re-imaging the next print with new
data while printing while also printing the current image. This means submitting data to be printed
immediately after a print has started, rather than waiting for the print to complete. Ensuring this
“image while printing” cycle is robust (that no data is lost or images printed twice) also entails ensuring
that both the imaging and printing process has completed before triggering the next print. NGPCL
provides the following commands to support this.
Job Update. The job update command is used to submit new field data to print. It takes a list of
{field name, data value} pairs as its arguments. In addition, a reply timing argument is used to state
whether the response should be sent immediately, or after the imaging process has completed. When
the reply timing is reply immediately, the response to this command indicates whether all fields to be
updated could be located in the image. When the reply timing is reply when job imaged, the response
to this command indicates whether all fields to be updated were successfully updated.
In this context, we cannot trigger a print until a fresh image has been prepared, so the reply when job
imaged reply timing is used. A job update command may, however, complete before the printer has
finished printing the previous image. It is therefore not safe to trigger a print immediately after a
reply to job update command is received.
Prin Status Request. In order to ensure the NGE Device is ready to print, the PrintStatusRequest
command can be used. The response to this command indicates whether the system is currently
printing, in a fault state or ready to action a fresh print trigger. A reply timing argument is used to
specify whether the response is reply immediately, or reply when ready to print.
In this context, we want the check-weigh application to wait until the previous print has completed
before triggering the next print. The reply when ready to print reply timing is therefore used.
Print Request. The print request command is used to trigger a print. A reply timing argument is
used to specify whether the response is reply immediately, reply when print started or reply when print
complete.
In this context, we do not want to wait until the print has completed as this would unnecessarily delay
re-imaging with fresh data. However, we do not want to submit fresh data and invoke the re-imaging
process immediately, as we may overwrite the previous image before before it is printed. The reply
when print started reply timing is therefore used. This guarantees the current image buffer will not be
refreshed before it is printed.
The diagram below shows the above messages being sequenced to run a checkweigh application
supporting re-imaging while printing. In addition, it shows the JobSelect command being used to
select a job.

Page 38 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
Line Controller Printer

NGPCL
JobSelect

PrepareImage
JobSelectReply

PrintRequest

PrintRequestReply

JobUpdate
Print

PrepareImage

JobUpdateReply
ReturnHeadToStart
PrintStatusRequest

PrintStatusReply

PrintRequest

PrintRequestReply

JobUpdate
Print()

10.3 NGPCL Image While Printing Print Cycle


Commands Example

The following provides an example of the NGPCL commands submitted to the NGE Device to run
the above print cycle.

STX ~JU1||0|User Input Barcode|0123456789128|Weight|12.50g|Price|£30.50| ETX


STX ~PS|1| ETX
STX ~PG|0|1| ETX

Page 39 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
10.4 NextGen PCL / Legacy PCL Compatibility.

NextGen PCL is designed to be backwards compatible with the legacy PCL supported by the SD3 and
Cimjet (ASCII Comms). While NGPCL packets are intended to start with STX and end with ETX, the
legacy PCL packet delimiters ^A and ^Z can be used in their place. Likewise the NextGen PCL
message start character (~) can be replaced with the legacy PCL ^ character.
There are, however, some differences between the commands intended to be used to submit fresh
data between prints.
The legacy Update Variable Fields command takes a list of {field number, data-value } pairs. In
contrast, the NGPCL Job Update command requires a sequence of { field name, field value } pairs.
In order to maintain backwards compatibility, NextGen PCL supports the legacy UpdateVariable
Fields command in the following way: field numbers are determined by the position of the field within
the image file.
The consequence of using this legacy command to update field data is a slightly lower pack rate. It
is therefore advisable to use the new Job Update command.

Page 40 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
11 Adopter specific commands

11.1 5600/5800 specific commands

11.1.1 Counts Values


Sent by NGE device in response to a ‘Request Counts’ message

Response Field Field Length Notes


Message Identifier ~CV
Count Type 5 Characters A code defining the count type
Message Body
Count Value 9 Characters

Count Type and Value will be repeated within the message body.
Example
~CVTOTAL|000000000|BATCH|000000000|
The number of counts reported will be defined by the adopter project. The NextGen core defines the
following counts that shall always be sent (in this order first):

Count Count type code


Total Print Count TOTAL
Batch Print BATCH
Count
Additionally the following counts will be sent by a 5600/5800 device in any order (after the previously
listed counts):

Count Count type code


Total Fail Count TFAIL
Batch Fail BFAIL
Count

11.1.2 Remote Purge


Sent to NGE Device to request a remote purge. It is implemented as a User Command.

Response Field Field Length Notes


Message Identifier ~UC
RP 2 Characters Specifies Remote Purge
Message Body
Printhead 3 Characters Printhead to purge; “PH1” or “PH2”

Example:
~UCRP|PH2|

Page 41 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc
11.1.3 Clear Print Queue
Sent to NGE Device to request that it clears out the print queue. It is implemented as a User
Command.

Response Field Field Length Notes


Message Identifier ~UC
Message Body CPQ 3 Characters Specifies Clear Print Queue

Example:
~UCCPQ|

Page 42 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc

You might also like