The purpose of functions is to manipulate the data that is assigned to label objects. Functions process the existing data source values and store the result in function-generated data sources.
Each function can be directly connected to an object and used as a part of another function.
Tip
All label or solution functions are listed in the Dynamic Data Explorer and Dynamic Data Manager.
To add a new function to a label or solution file, click Add new function and select the appropriate function from the list. As soon as you add a new function, a configuration dialog appears enabling you to edit the function according to your needs. Configuration options are described in dedicated sections for each function type.
Desktop Designer includes the following function types:
-
Subset: extracts a specific part of data according to the user-specified rules.
-
Concatenate: merges two or more data source values into a single value.
-
Date Offset: offsets the present date.
-
Linear: transforms the current value using multiple types of linear functions.
-
VBScript: allows performing complex value transformations.
-
VBScript Expression: is a simplified version of VBScript function.
-
Python Script: allows performing complex value transformations.
-
HIBC: encodes the data in compliance with the health industry barcode standard.
-
GS1-128: encodes the data in compliance with the GS-128 barcode standard.
-
ANSI MH10.8.2: encodes the data in compliance with ANSI MH10.8.2-2006 standard.
-
Transfer Data Syntax for High Capacity ADC Media: enables the ADC users to use a single mapping utility, regardless of which high-capacity ADC media is employed.
-
Read from file: function reads content from a specified file and displays it in an object.
-
NDEF Message: function allows you to define a message encapsulation format for the exchange of data information over an Near Field Communication (NFC) link.
Subset function extracts a specific part of data according to the user-specified rules.
About group identifies the function.
Input data source defines the existing or newly added input data source (variable, function, or database record). The final (output) value is extracted from the selected input data source value.
Definition group offers two methods for extracting the data from the input data source.
Fixed length extracts a fixed number of characters from the input data source.
-
Offset: number of characters to be skipped from the beginning of the value.
-
Length: length of extracted value.
Delimited is used when extracting the data, separated by the user-specified delimiter.
-
Delimiter: character (comma by default) that separates input value fields.
-
Text qualifier: character that encloses the values within the fields (quotation mark by default).
Tip
If a text qualifier is used, the delimiter within the text qualifiers also belongs to the data value. Text qualifier can be left empty.
-
Field number:the field number that is extracted from the input data source.
Example 36. Example:
Input value: "A", "B", "C", "D"
Delimiter: ,
Text qualifiers: "
Field number: 3
Subset value: C
Concatenate function merges two or more data source values into a single value.
About group identifies the function.
Input data source group defines the existing or newly added input data source (variable, function or database record) or fixed text that will be used in the function.
Output Options group defines the output value format.
Delimiter is a character that is inserted between the concatenated values. The delimiting character can be entered manually or selected from one of the additional options:
-
New Line (CR/LF): new line character.
-
Insert special character: special character is entered.
Note
Delimiter is an optional value. With no delimiter defined, the concatenated values are merged without a delimiting space or character.
-
Ignore empty values: ignores empty data source values. These values are excluded from concatenation.
Tip
This option is useful if you want to avoid duplicated delimiters if empty values appear.
Example 37. Example:
Data source value 1: A, B, C, D
Data source value 2: <empt>
Data source value 3: E, F, G
Delimiter: ,
Concatenated value with vs. without Ignore empty values: A, B, C, D, E, F, G vs. A, B, C, D, E, F, G
Note
Ignore empty values option is effective only after executing a print command. When storing a label in store/recall printing mode or when exporting a label, the empty values are not ignored. Delimiters appear duplicated.
Date Offset function defines the number of days, months and/or years to be added to or subtracted from any specified date (might be the current date or any past/future date).
About group identifies the function.
Input data source defines the input data source from which the data will be used in the function.
Offset is the number of days, months, or years to be added to or subtracted from the input data source.
Output formatting group defines the function’s output.
-
Output format: defines the date format to be used in the connected object.
-
Sample: current date in the selected Output format.
Linear function multiplies or divides an input data source value by a defined Multiplier. An optional value (Addition) can also be added.
About group identifies the function.
Input data source defines the input data source from which the data will be used in the function.
Linear function parameters are:
-
Mode: linear function type.
-
a: function multiplier.
-
b: function addition.
Output formatting group defines the function output format.
Output format is the format of a modified value. more... opens additional formatting options:
-
Decimal separator: character that marks the border between integral and fractional parts of a decimal numeral.
-
Decimal places: number of places behind the decimal separator.
-
Use 1000 separator: thousands separated or non-separated by a delimiter.
-
Delimiter: character that separates the thousands from the rest of the numeral.
-
Sample: preview of the formatted output value.
VBScript function enables reading, writing, and manipulating the data that belongs to any of the connected data sources.
About group identifies the function.
-
Function type: show which type of scripting is selected.
VBScript group allows defining the script.
-
Insert data source: inserts an existing or a newly created data source into the script.
-
Verify: validates the entered script syntax.
-
Script editor: opens the editor which makes scripting easier and more efficient.
Note
The result of the script must be saved in the 'Result'. The value of 'Result' is inserted into the name of the function. Such function is available as a dynamic data source for further use.
Example 39. Example:
The variable NAME provides the first and last name of a person. VBScript function should break the names apart and use only the first name as the result of the function.
NAME variable initial value: John Doe
Dim Spc Spc = InStr(NAME, " ") if NAME <> "" then Result = Mid(NAME, 1, Spc-1) end if
Result of VBScript: John
Note
To verify if a date variable is empty, use the syntax:
Datevariable.Value == None
VBScript Expression is a simplified online version of VBScript function. This Desktop Designer function allows you to:
-
manipulate existing variables
-
extract sub-strings
-
perform quick calculations
VBScript Expression reduces the need to write dedicated VBScripts. Instead of writing an entire script, insert a single-line expression in the edit field that is validated at print time.
Tip
When compared to VBScript commands, a VBScript expression command does not require the final value to be stored in Result.
About
VBScript Expression
-
Insert data source: inserts an existing or a newly created data source into the expression.
-
Verify: validation of the entered script syntax.
-
Editor: field for script writing and editing.
NiceLabel 10 provides a script editor which makes your Python or VBScript scripting easier, error-free and time efficient.
The selection of scripting languages that should be used in Script editor differs between NiceLabel Designer Pro and Automation Builder :
-
In Desktop Designer , double-click on the form design surface to open Form Properties > Additional Settings > Form Scripting Language.
-
In Automation Builder , go to Configuration items > click Edit to open trigger properties > Settings > Other > Scripting.
Tip
NiceLabel 10 uses .NET variant of Python named IronPython. It works as a fully compatible implementation of Python scripting language which also supports .NET methods.
Editor Ribbon includes commonly used commands which are distributed over multiple functional groups.
-
Clipboard group offers Cut, Copy, Paste and Delete commands.
-
Undo Redo group allows undoing or repeating script editing actions.
-
File group allows loading and saving scripts in a file.
-
Load from file: loads a script from an external previously saved textual file.
-
Save to file: stores the currently edited script in a textual file.
-
-
Editing group allows finding and replacing strings in a script.
-
Find: locates the entered string in the script.
-
Replace: replaces string in the script.
-
-
Insert group: Data Source command inserts existing or newly defined data sources into the script.
-
Script group: Validate script command validates of the entered script's syntax.
Available scripting elements contain all available script items which can be used when building a script. Double-click the element or click the Insert button to insert the element at cursor position into the script.
Element description provides basic information about the inserted script element.
Error list includes the errors which are reported after the Validate script command is run.
Python script function supports even the most complex data manipulations on a label or a form.
Tip
When compared with VBScript, it proves to be a more suitable option for 64-bit systems. It is also proved to be a notably faster scripting alternative.
About group identifies the function.
-
Function type: show which type of scripting is selected.
Python Script
-
Insert data source: inserts an existing or a newly created data source into the script.
-
Verify: validates the entered script syntax.
-
Script editor: opens the editor which makes scripting easier and more efficient.
Example 40. Example:
The variable NAME provides the first and last name of a person. Python Script function should break the names apart and use only the first name as the result of the function.
NAME variable initial value: John Doe
name = NAME.Value Spc = name.find(' ') if name != '' and Spc != -1: Result.Value = name[0:Spc] else: Result.Value = name
Result of Python script: John
HIBC is a barcode standard used specifically in the health industry, as directed by the HIBCC organization. This standard supports composite bar codes and supports the use of multiple items such as item codes, quantity, and a batch number in a single barcode.
Tip
Visit HIBCC website for more information about the standard.
About group identifies the function.
Structure group selects standard version and one of the three available HIBC barcode Types:
-
Version: HIBC version selector. Labels which include legacy HIBC data encoding are opened using version 2.5. If creating a new label, encoding works depending on the selected HIBC version – 2.5 or 2.6.
-
Type: data structure type selector.
-
Primary: mandatory fixed data structure which identifies the item and its supplier.
-
Secondary: optional data structure which is indicated using the "/" delimiter. It may have a variable (yet predefined) structure to contain serial or batch numbers, quantity, and expiration date.
-
Primary definition: mandatory element when defining the Secondary data structure. The three Primary data fields of a HIBC function must be added to the Secondary data structure. Primary definition selects the appropriate existing HIBC function.
-
-
Concatenated: merges the first two structure types into a single data structure.
-
Definition group defines the content of HIBC barcode fields:
Primary data structure fields:
-
Labeler ID code (LIC): field assigned and maintained by the HIBCC. The first character of this field is always an alphabetic character. The LIC may identify a labeler to the point of separate subsidiaries and divisions within a parent organization.
-
Product or Catalog...: compressed product or catalog number.
-
Unit of Measure...: numeric representation of packaging level (0 to 9) with 0 being the lowest level or “unit-of-use”.
Example 41. Example:
A company might pack unit-of-use items in a box, boxes in a carton, and cartons in a case. One way of labeling would be, unit-of-use = 0; Box = 1; Carton = 3; and Case = 5.
Secondary data structure fields:
-
Quantity: two- or five-digit field describing the number of units-of-use included in the package identified by the bar code label.
-
Date format: preferred date format to be used with a HIBC label. If no date should be included on a label, select one of the formats that contain "No date".
-
Date: displays the present date.
-
Lot/Batch: field can be alphanumeric and may vary in length to up to a maximum of 18 characters. If the field is not required, it should be left empty.
-
Serial number: field can be alphanumeric and may vary in length to up to a maximum of 18 characters. If the field is not required, it should be left empty.
-
Production date: Data Identifier formatted as YYYYMMDD.
GS1-128 function encodes barcode data using the GS1-128 standard. The standard supports the encoding of textual data, numbers, functions, and the entire set of 128 ASCII characters.
GS1-128 encodes the data and defines its meaning by defining a list of Application Identifiers (AI). These identifiers define the content and length of the data they include.
AIs include a data field that contains a fixed or variable number of characters.
Tip
For more information about GS-128 standard and encoding principles, visit the GS1 website.
The list of available AIs is available here.
About
Application Identifiers field displays the selected AIs.
Edit Function Definition button opens a dialog for editing the identifiers. Function Definition dialog allows the user to Add, Delete, Move, and edit the selected identifiers. There are four columns with identifier properties:
-
Identifier: column with identifier AI number and description.
-
Value: column with a manually or dynamically defined value as given by the selected Data source.
Tip
Value column makes sure the values are compliant with GS1-128 standard. The values are automatically reformatted according to AI format and length.
-
Options: column with additional identifier options (if available).
Delimiter group defines the delimiting characters for separating the AIs.
A single barcode may include multiple AIs. These fields are separated using left and right Delimiter. By default, the first two digits of AI are used. Custom delimiters may be defined by inserting alphanumeric characters.
Additional function outputs group defines a subordinate function.
-
Create output function with unformatted contents creates a subordinate function that uses the unformatted data encoded by the parent GS1-128 function.
-
Function name: the name of the newly created subordinate function.
ANSI MH10.8.2 (ASC) function encodes barcode data using the ANSI MH10.8.2-2006 standard. This standard provides a range of MH 10/SC 8 data identifiers and GS1 application identifiers. It enables the assignment of new data identifiers and defines the correlation or mapping of data identifiers to application identifiers.
Tip
For more information about ANSI MH10.8.2 (ASC) standard, visit the official website. ANSI MH10.8.2 belongs to ISO/IEC 15418 standard, which is accessible here.
About group identifies the function.
Application Identifiers enable cross-industry standardized use of data identifiers. They are used with any alphanumeric data carrier.
Edit Function Definition button opens the Function Definition dialog. It allows the user to Add, Delete, Move, and edit the selected identifiers.
There are three columns with identifier properties:
-
Identifier: column with identifier ID.
-
Value: column with manually inserted value or an automatically defined value as given by the selected Data source.
Note
Each Value column allows a limited number of characters to be entered. The limitation (format) is defined by the standard and varies according to the selected identifier.
This function supports the international ISO/IEC FDIS 15434 standard for "Information technology – Automatic identification and data capture techniques – Syntax for high-capacity ADC media".
The standard defines the manner in which data is transferred to high-capacity automatic data capture (ADC) media from the supplier’s information system and the manner in which the data is transferred to the recipient’s information system.
The standard uses high-capacity technologies, such as two-dimensional symbols, to encode multiple fields of data. These fields are usually parsed by the recipient’s information system and mapped to specific data fields in the recipient’s information system.
This function allows you to encode data in the label objects. You can combine several pieces of information in a single message. Each part begins with a header, and is followed by the message. Each data field may have a fixed manually entered value, or can be connected to a variable.
Note
Make sure the variable has the same data format as required by the data identifier. Data identifiers usually have a strict format set by the standard.
About group identifies the function.
-
Application Identifiers: cross-industry standardized set of data identifiers.
Tip
The purpose of identifiers is to provide a unique item identification. To manage the identifiers, click Edit Function Definition.
Function Definition dialog allows the user to Add, Delete, and edit the selected identifiers.
-
Format Envelope: column defines the starting and ending positions for a data item in a given Format. Each Format Envelope contains a Format Header, data and a Format Trailer.
Example 42. Example:
-
Format envelope 02 represents Complete EDI message/transaction data.
-
Format envelope 06 represents data which is encoded using ASC MH 101 Data Identifiers.
-
Data Elements: column defines the identifier content. Insert the data to be encoded manually or define a data source.
-
Format Header Data: defines two mandatory format header elements.
-
Version: organization that controls the data structure.
Note
Each identifier allows adding multiple elements.
-
Release: release number of ADC media standard.
-
Read from file function reads content from a specified file. The file can be accessed locally or remotely via the network connection.
About group identifies the function.
Read from file parameters group sets the file connection details.
File name sets the file connection.
Encoding specifies the encoding type for the sent data.
-
Auto: automatically defined encoding .
Tip
If needed, select the preferred encoding type from the dropdown list.
NDEF Message function allows you to define a message encapsulation format for the exchange of data information over a Near Field Communication (NFC) link. Such link is established between two NFC devices, or between an NFC device and a tag.
Tip
NFC is a set of communication protocols that enable two devices to establish communication by bringing them within 4 cm (2 in) of each other.
NDEF message encapsulates one or more application-defined records which appear in a variety of types and sizes. These records are combined into a single message.
Note
Output of this function is in HEX format.
About group identifies the function.
NDEF Message Structure group displays the NDEF records that are included in the message.
Click Edit Function definition to open the NDEF Message dialog. This dialog allows the user to Add, Delete, Move, and edit the NDEF records. There are two columns with record properties:
-
NDEF Record Type: identifies the record type. The listed standard record types are available in Desktop Designer:
-
Uri: contains a string of characters that identifies a web resource.
-
Text: contains textual content with information about text encoding and language code.
-
Smart Poster: includes multiple sub-records – URI, title, recommended actions, icon, size and type.
Note
Smart Poster content is represented as a single record content, although internally the structure is created as multiple (sub)records within a single record.
-
BlueTooth Handover Select: a set of records including various items – handover version, device address string, complete local string, class of device, and service class.
-
Custom: record type which allows encoding the non-native NFC data.
Tip
Drag and drop the records in NDEF Message dialog to quickly change their position.
Tip
Detailed descriptions of NDEF record types are available in NFC Forum technical specifications.
-
-
Record Definition: settings as defined by the NDEF standard. Available options depend on the selected record type.
Include capability container adds capability container to the encoded data. Capability container stores control data for managing the NFC data in a tag or a device. It tells the NFC device that the received data is an NFC message. In cases when NFC content needs to be encoded into a standard high frequency (HF) RFID tag, enable the Include capability container option. This signalizes the reading device that NFC content is stored in the tag. Certain NFC compliant tags already include a capability container in the tag which means that there is no need for including it as a part of the generated content.