ng:serializationData

ng:serializationData

The built-in function, ng:serializationData can help you if you want to print multiple labels on a ZPL compatible printer, that are all identical apart from a number, which is increased/descreased for each label.

 

You can use this to reduce the size of the print data stream and increase print performance.

Prerequisites/limitations: This function only works for ZPL output. It is also only supported for a single page output, that is printed in multiple copies. This function should be the main XPath function used in a text element. If you want to use similar functionality for a barcode, then you should use the ng:serializationBarcode function, which was added in version 4.2.0.


The function injects the ^SF serilization field into the barcode in ZPL. The field will inject the values directly, which means we strongly recommend reading the ^SF section in the 
Zebra Programming Guide. At writing time available at https://www.zebra.com/content/dam/support-dam/en/documentation/unrestricted/guide/software/zpl-zbi2-pg-en.pdf on page 334

The ng:serializationData can e.g. be called with this command: ng:serializationData('00001','3','y') and here are descriptions of the 3 parameters:

 

First parameter: Starting value

  • This can be any numeric value with up to 12 digits. It can also be an alphanumeric text that ends with a number.

Second parameter: Increment (up to 12 digits).

  • This can be any numeric value with up to 12 digits. This can also be negative e.g. '-1' to reduce the value with one for each new label.

Third parameter: Keep leading zeroes

  • Allowed values are: "y" and "n". A "y" indicates, that leading zeroes should be included in the output and with "n" any leading zeroes are removed in the output.

 

Examples of use:

ng:serializationData('00001','3','y') = Number on the labels will be 00001, 00004, 00007…
ng:serializationData('00001','3','n') = Number on the labels will be 1,4,7…
ng:serializationData('5','1','n') = Number on the labels will be 5,6,7…
ng:serializationData('PartNo005','-1','y') = Labels will output PartNo005, PartNo004, PartNo003…

Here you can find an example of printing three labels with the numbers:
The built-in function, ng:serializationData can help you if you want to print multiple label on a ZPL compatible printer, that are all identical apart from a number, which is increased for each label.

Here you can find an example of printing three labels with the numbers:
img1

This prints out the number: 00001 and prepares the printer to increment the value with 1 for each copy.

 

If this template is used in a workflow, which prints multiple copies like below, then the output in this case will be 3 labels with the values 00001, 00002 and 00003:

img2
  
The advantage is, that only a single page element is sent to the printer, so the print speed will be as fast as the printer can print at all – with the selected print speed.

Example: Generic template prints out variable data from the workflow

Here is a generic template, that prints out dynamic data, that is setup in the workflow. The template looks like this:

Here three workflow variables has been defined: LeadingZeroes, Step and Start.
They are all expected to be set in the workflow before this template is used for printing ZPL. 

The matching workflow looks like this:

The workflow sets the required workflow variables and the predefined variable, interform.destination.printer.copies before printing.
The result is two labels with the text: PartNo005 (on the first label) and PartNo004 (on the second label).

    • Related Articles

    • ng:serializationBarcode

      The built-in function, ng:serializationBarcode can help you if you want to print multiple labels on a ZPL compatible printer, that are all identical apart from a barcode with contents, which is increased/descreased for each label. You can use this to ...
    • ng:decrypt

      The built-in function, ng:decrypt is linked with the encryption functions: ng:encrypt and the workflow component, Set secure workflow variable. The function, ng:decrypt() can decrypt contents, that was previously encrypted with these functions. The ...
    • ng:minimum

      InterformNG2 includes the special built-in XPath function, ng:minimum. This function returns the smallest value of two numeric arguments. The function only accepts two numeric arguments - no more and no less. Examples: ng:minimum(-14,2) returns: -14 ...
    • ng:base64

      The built-in function, ng:base64() converts a string (text) into a base64 based string. This can e.g. be used, if you want to insert any kind of data into an XML node, without substituting any characters, that are not allowed. This function is ...
    • ng:spaceConcat

      The built-in function, ng:spaceConcat(), helps concatenate two strings with a space character automatically inserted between them. Here is an example: This XPath expression: ng:spaceConcat('First name:', 'Jon') outputs this string: First name: Jon ...