NGPCL Users Guide v25
NGPCL Users Guide v25
NGPCL Users Guide v25
Document Author:
Name Position
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
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
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.
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:
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’
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.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.
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
The Status field will always have the value 1 indicating failure.
Example
~NK1|
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).
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.
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)
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.
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
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.
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.
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)
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.
Example:
~DS1|0|0|0|0|1|000000005|06|1|
~DS0|1|0|0|0|0|1|000000005|06|1| (if ‘Status’ field enabled)
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|
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’.
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.
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):
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.
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.
Example
~SVdarkness|90|
~SV0|darkness|90| (if ‘Status’ field enabled.
Example
~PG|0|0|
Command Reply:
~PG0|
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.
Example
~PR0|
~PR0|0| (if ‘Status’ field enabled)
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.
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
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.
Example
~SI0000001X|
This command clears virtual inputs 1 – 6, sets virtual input 7 and leaves virtual input 8
unchanged.
Example
~RC
Example
~CC10:25:40 04/12/2003|
~CC0|10:25:40 04/12/2003| (if ‘Status’ field enabled)
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|
Example
~VR
The adopter may define and add extra version information to this message.
Example:
~VV001|001|001|
~VV0|001|001|001| (if ‘Status’ field enabled)
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.
Example:
Request: ~PV|
Response: ~VP2.0|
~VP0|2.0| (with optional status field)
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: ~FD1024|<FileData>|
Response: ~FD0|
Example with packet numbers:
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’.
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.
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.
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
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()
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.
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
JobSelect
RequestFile(job)
FileTransferResponse
RequestFile(image)
FileTransferResponse
RequestFile(settings)
FileTransferResponse
PrepareImage
ImagingComplete
JobSelectedEvent()
JobSelectReply
ClearToSendData
ClearToSendDataReply
JobUpdate
Print
PrintComplete
PrepareImage ReturnHeadToStart
CycleComplete
ImagingComplete
JobUpdateReply
Print
ClearToSendData()
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.
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()
The following provides an example of the NGPCL commands submitted to the NGE Device to run
the above print cycle.
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
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):
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.
Example:
~UCCPQ|
Page 42 of 42
C:\Users\DBreakwell\Documents\MIBUSINESS\Products\Software\protocol's\NextGen\NGPCL\ngpclu
sageguide v25.doc