Reference and Troubleshooting

Command File Types

Command Files Specifications

Command files contain instructions for the print process. These instructions are expressed with Loftware commands. Commands are executed one at a time from beginning to the end of the file. The files support Unicode formatting, so you can include multi-lingual contents. Command files come in three different flavors.

CSV Command File

The commands available in CSV command files are a subset of Loftware commands. The following commands are available: LABEL, SET, PORT, PRINTER and PRINT.

CSV stands for Comma Separated Values. CSV file is a text file in which values are delimited by comma (,) character. Such text file can contain Unicode value (important for multi-language data). Each line in the CSV command file contains commands for a single label print action.

The first row in a CSV command file must contain commands and variable names. The order of commands and names is not important, but all records in the same data stream must follow the same structure. Variable name-value pairs are extracted automatically and sent to the referenced label. If the variable with the name from CSV does not exist on the label, no error message is displayed.

Sample CSV Command File

The sample presents the structural view on the fields that you can use in the CSV command file.

@Label,@Printer,@Quantity,@Skip,@IdenticalCopies,NumberOfSets,@Port,Product_ID, Product_Name
label1.nlbl, CAB A3 203 DPI, 100, , , , , 100A, Product 1
label2.nlbl, Zebra R-402, 20, , , , , 200A, Product 2

CSV Commands Specification

The commands in the first line of data must be expressed with at (@) character. The fields without @ at the beginning are names of variables. These fields are extracted with their values as name-value pairs.

  • @Label: Specifies the label name to be used. It's a good practice to include label path and filename. Make sure the service user can access the file. For more information, see section Access to Network Shared Resources in Loftware Automation user guide. A required field.

  • @Printer: Specifies the printer to be used. It overrides the printer defined in the label. Make sure the service user can access the printer. For more information, see section Access to Network Shared Resources. Optional field.

  • @Quantity: Specifies the number of labels to be printed. Possible values: numeric value, VARIABLE or UNLIMITED. For more information, see section Print Label. A required field.

  • @Skip: Specifies the number of labels to be skipped at the beginning of the first printed page. This feature is useful if you want to re-use the partially printed sheet of labels. Optional field.

  • @IdenticalCopies: Specifies the number of label copies that should be printed for each unique label. This feature is useful when printing labels with data from database or when you use counters, and you need label copies. Optional field.

  • @NumberOfSets: Specifies the number of times the printing process should repeat. Each label set equals a single occurrence of printing process. Optional field.

  • @Port: Specifies the port name for the printer. You can override the default port as specified in the printer driver. You can also use it to redirect printing to file. Optional field.

  • Other field names: All other fields define names of variables from the label. The field contents are saved to the variable of the same name as its value.

JOB Command File

JOB command file is a text file that contains Loftware commands. The commands execute in top-to-bottom order. The commands usually start with LABEL (to open label), then SET (to set variable value) and finally PRINT (to print label). For more information about the available commands, see section Using Custom Commands.

Sample JOB Command File

This JOB file open label2.nlbl, sets variable values and prints a single label. Because no PRINTER command is used to redirect printing, the gets printed using the printer name as defined in the label.

LABEL "label2.nlbl"
SET code="12345"
SET article="FUSILLI"
SET ean="383860026501"
SET weight="1,0 kg"
PRINT 1

XML Command File

The commands available in the XML Command files are a subset of Loftware commands. The following commands are available: LOGIN, LABEL, SET, PORT, PRINTER, SESSIONEND, SESSIONSTART and SESSIONPRINT. The syntax for these commands differs to some extent if they are used in an XML file.

Root element in the XML Command file is <Nice_Commands>. The next element that must follow is <Label>. This element specifies the label to be used.

To start printing the labels , there are two available methods: print labels normally using the element <Print_Job>, or print labels in a session using the element <Session_Print_Job>. You can also change the printer to which the labels are printed, and additionally set the variable value.

Sample XML Command File

The sample below serves as a structural overview of the elements and their attributes as you can use them in an XML command file.

<nice_commands>    <label name="label1.nlbl">        <session_print_job printer="CAB A3 203DPI" skip=0 job_name="job name 1" print_to_file="filename 1">            <session quantity="10">                <variable name="variable name 1" >variable value 1</variable>            </session>        </session_print_job>        <print_job printer="Zebra R-402" quantity="10" skip=0 identical_copies=1 number_of_sets="1" job_name="job name 2" print_to_file="filename 2">            <variable name="variable1" >1</variable>            <variable name="variable2" >2</variable> 
            <variable name="variable3" >3</variable>        </print_job>    </label></nice_commands>

XML Command File Specification

This section contains description of the XML Command file structure. There are several elements that contain attributes. Some attributes are required while the others are optional. Some attributes can occupy pre-defined values only, while for the others, you can specify custom values.

  • <Nice_Commands>: This is a root element.

  • <Label>: Specifies the label file to be opened. If the label is already opened, it does not re-open. The label file must be accessible from this computer. For more information, see section Access to Network Shared Resources. This element can occur several times within the command file.

    • Name: This attribute contains label name. You can include the path along with the label name. Required.

  • <Print_Job>: The element that contains data for a single label job. This element can occur several times within the command file.

    • Printer:: Use this attribute to override the printer defined in the label. The printer must be accessible from this computer. For more information, see section Access to Network Shared Resources. Optional.

    • Quantity: Use this attribute to specify the number of labels to be printed. Possible values: numeric value, VARIABLE or UNLIMITED. For more information on parameters, see section Print Label. Required.

    • Skip: Use this attribute to specify how many labels should be skipped at the beginning. This feature is useful if you print a sheet of labels to laser printer, but the sheet is partial already printed. For more information, see the see section Print Label. Optional.

    • Job_name: Use this attribute to specify the name of your job file. The specified name is visible in the print spooler. For more information, see section Set print job name. Optional.

    • Print_to_file: Use this attribute to specify the file name to which you want to save the printer commands. For more information, see section Redirect Printing to File. Optional.

    • Identical_copies: Use this attribute to specify the number of copies you need for each label. For more information, see section Print Label. Op

  • <Session_Print_Job>: The element that contains commands and data for one or more sessions. The element can contain one or more <Session> elements. It considers session print rules. You can use this element several times within the command file. For available attributes, look up the attributes for the <Print_Job> element. All of them are valid, you just cannot use the quantity attribute. See the description of <Session> element to find out how to specify label quantity in session printing.

  • <Session>: The element that contains data for one session. When printing in session, all labels are encoded into a single print job and sent to the printer.

    • Quantity: Use this attribute to specify the number of printed labels. Possible values: numeric value, string VARIABLE, or string UNLIMITED. For more information on parameters, see section Print Label. Required.

  • <Variable>: The element that sets the variable values on the label. This element can occur several times within the command file.

    • Name: The attribute contains the variable name. Required.

XML Schema Definition (XSD) for XML Command File

<?xml version="1.0" encoding="utf-8"?><xs:schema targetNamespace="http://tempuri.org/XMLSchema.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/XMLSchema.xsd" xmlns:mstns="http://tempuri.org/XMLSchema.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema">    <xs:element name="nice_commands">        <xs:complexType>            <xs:sequence>                <xs:element name="label" maxOccurs="unbounded" minOccurs="1">                    <xs:complexType>                        <xs:sequence>                            <xs:element name="print_job" maxOccurs="unbounded" minOccurs="0">                                <xs:complexType>                                    <xs:sequence>                                        <xs:element name="database" maxOccurs="unbounded" minOccurs="0">                                            <xs:complexType>                                                <xs:simpleContent>                                                    <xs:extension base="xs:string">                                                        <xs:attribute name="name" type="xs:string" use="required" />                                                    </xs:extension>                                                </xs:simpleContent>                                            </xs:complexType>                                        </xs:element>                                        <xs:element name="table" maxOccurs="unbounded" minOccurs="0">                                            <xs:complexType>                                                <xs:simpleContent>                                                    <xs:extension base="xs:string">                                                        <xs:attribute name="name" type="xs:string" use="required" />                                                    </xs:extension>                                                </xs:simpleContent>                                            </xs:complexType>                                        </xs:element>                                        <xs:element name="variable" maxOccurs="unbounded" minOccurs="0">                                            <xs:complexType>                                                <xs:simpleContent>                                                    <xs:extension base="xs:string">   
                                                        <xs:attribute name="name" type="xs:string" use="required" />                                                    </xs:extension>                                                </xs:simpleContent>                                            </xs:complexType>                                        </xs:element>                                    </xs:sequence>                                    <xs:attribute name="quantity" type="xs:string" use="required" />                                    <xs:attribute name="printer" type="xs:string" use="optional" />                                    <xs:attribute name="skip" type="xs:integer" use="optional" />                                    <xs:attribute name="identical_copies" type="xs:integer" use="optional" />                                    <xs:attribute name="number_of_sets" type="xs:integer" use="optional" />                                    <xs:attribute name="job_name" type="xs:string" use="optional" />                                    <xs:attribute name="print_to_file" type="xs:string" use="optional" />                                    <xs:attribute name="print_to_file_append" type="xs:boolean" use="optional" />                                    <xs:attribute name="clear_variable_values" type="xs:boolean" use="optional" />                                </xs:complexType>                            </xs:element>                            <xs:element name="session_print_job" maxOccurs="unbounded" minOccurs="0">                                <xs:complexType>                                    <xs:sequence>                                        <xs:element name="database" maxOccurs="unbounded" minOccurs="0">                                            <xs:complexType>                                                <xs:simpleContent>                                                    <xs:extension base="xs:string">       
                                                        <xs:attribute name="name" type="xs:string" use="required" />                                                    </xs:extension>                                                </xs:simpleContent>                                            </xs:complexType>                                        </xs:element>                                        <xs:element name="table" maxOccurs="unbounded" minOccurs="0">                                            <xs:complexType>                                                <xs:simpleContent>                                                    <xs:extension base="xs:string">                                                        <xs:attribute name="name" type="xs:string" use="required" />                                                    </xs:extension>                                                </xs:simpleContent>                                            </xs:complexType>                                        </xs:element>                                        <xs:element name="session" minOccurs="1" maxOccurs="unbounded">                                            <xs:complexType>                                                <xs:sequence>                                                    <xs:element name="variable" minOccurs="0" maxOccurs="unbounded">                                                        <xs:complexType>    
                                                            <xs:simpleContent>                                                                <xs:extension base="xs:string">                                                                    <xs:attribute name="name" type="xs:string" use="required" />                                                                
                                                                </xs:extension>       
                                                            </xs:simpleContent>                                                        </xs:complexType>                                                    </xs:element>                                                </xs:sequence>                                                <xs:attribute name="quantity" type="xs:string" use="required" />                                            </xs:complexType>                                        </xs:element>                                    </xs:sequence>                                    <xs:attribute name="printer" type="xs:string" use="optional" />                                    <xs:attribute name="skip" type="xs:integer" use="optional" />                                    <xs:attribute name="job_name" type="xs:string" use="optional" />                                    <xs:attribute name="print_to_file" type="xs:string" use="optional" />                                    <xs:attribute name="print_to_file_append" type="xs:boolean" use="optional" />                                    <xs:attribute name="clear_variable_values" type="xs:boolean" use="optional" />                                </xs:complexType>                            </xs:element>                        </xs:sequence>                        <xs:attribute name="name" type="xs:string" use="required" />                        <xs:attribute name="close" type="xs:boolean" use="optional" />                        <xs:attribute name="clear_variable_values" type="xs:boolean" use="optional" />                    </xs:complexType>                </xs:element>            </xs:sequence>            <xs:attribute name="quit" type="xs:boolean" use="required" />        </xs:complexType>    </xs:element></xs:schema>

Oracle XML Specifications

Oracle defines the XML format so that the XML contents can be understood, parsed and printed on labels. The XML Document Type Definition (DTD) defines the XML tags that are used in an XML file. Oracle generates XML files according to this DTD, and any 3rd party software translates XML files according to this DTD.

To execute an Oracle XML command file, use the Run Oracle XML Command File action.

XML DTD

The following is the XML DTD that is used while forming an XML for both – synchronous and asynchronous XML formats. The DTD defines elements that are used in the XML file, list of their attributes, and next level elements.

<!ELEMENT labels (label)*><!ATTLIST labels _FORMAT CDATA #IMPLIED><!ATTLIST labels _JOBNAME CDATA #IMPLIED><!ATTLIST labels _QUANTITY CDATA #IMPLIED><!ATTLIST labels _PRINTERNAME CDATA #IMPLIED><!ELEMENT label (variable)*><!ATTLIST label _FORMAT CDATA #IMPLIED><!ATTLIST label _JOBNAME CDATA #IMPLIED><!ATTLIST label _QUANTITY CDATA #IMPLIED>
Sample Oracle XML

This is the Oracle XML providing data for one label (there is only one <label> element).

<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE labels SYSTEM "label.dtd"><labels _FORMAT ="Serial.nlbl" _QUANTITY="1" _PRINTERNAME="" _JOBNAME="Serial">    <label>        <variable name= "item">O Ring</variable>        <variable name= "revision">V1</variable>        <variable name= "lot">123</variable>        <variable name= "serial_number">12345</variable>        <variable name= "lot_status">123</variable>        <variable name= "serial_number_status">Active</variable>        <variable name= "organization">A1</variable>    </label></labels>

When executing this sample Oracle XML file, the label serial.nlbl is printed with the following variable values.

Variable name

Variable value

item

O Ring

revision

V1

lot

123

serial_number

12345

lot_status

123

serial_number_status

Active

organization

A1

There will be 1 printed copy of the label with spooler job name Serial. The printer name is not specified in the XML file, so the label prints to the printer as defined in the label template.

SAP AII XML Specifications

Loftware Automation can present itself as an RFID device controller, capable of encoding RFID tags and printing labels. For more information about SAP AII XML specifications, see the document SAP Auto-ID Infrastructure Device Controller Interface on SAP web page.

To execute such command file, use the Run SAP AII XML Command File action.

Sample SAP AII XML

This is the SAP AII XML providing data for one label (note that there is only one <label> element).

<?xml version="1.0" encoding="UTF-8"?><Command xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Command.xsd">    <WriteTagData readerID="DEVICE ID">        <Item>            <FieldList format="c:\SAP Demo\SAP label.nlbl" jobName="Writer_Device20040929165746" quantity="1">            <Field name="EPC">00037000657330</Field>            <Field name="EPC_TYPE">SGTIN-96</Field>            <Field name="EPC_URN">urn:autoid:tag:sgtin:3.5.0037000.065774.8</Field>            <Field name="PRODUCT">Product</Field>            <Field name="PRODUCT_DESCRIPTION">Product description</Field>            </FieldList>        </Item>    </WriteTagData></Command>

When executing this sample SAP AI XML file, the label c:\SAP Demo\SAP label.nlbl is printed with the following variable values.

Variable name

Variable value

EPC

00037000657330

EPC_TYPE

SGTIN-96

EPC

urn:autoid:tag:sgtin:3.5.0037000.065774.8

PRODUCT

Product

PRODUCT_DESCRIPTION

Product description

There will be 1 printed copy of the label with spooler job name Writer_Device2004092916574. Printer name is not specified in the XML file, so the label will be printed using the printer that is defined in the label template.

PAS Command File

PAS command file is text file that contains Loftware LPS printing commands. The commands execute in order from top to bottom. Each PAS file must start with the *FORMAT (open label) command, and end with the *PRINTLABEL command.

PAS command file can be executed using the action Run Command File.

[Note] Note

If you migrated from Software to NiceLabel, you could use your existing PAS command files with NiceLabel label templates (.nlbl) *FORMAT command checks if the.nlbl file exists with the same name as .lwl.

PAS Command File Example
*FORMAT,\\127.0.0.1\labelcomputer$\labels\ML2193.lwl
*JOBNAME,PastaPallet002
*QUANTITY,1
*PRINTERNUMBER,1
Text0000,New Data
Text0001,New Data
*PRINTLABEL
[Note] Note

If you want to use *PRINTERNUMBER command, you must copy the printr32.ini file from LPS to c:\Program Files\Loftware\Loftware\bin.net\Configuration.

You can find more details about PAS commands in Loftware LPS User Guide.

Custom Commands

Using Custom Commands

Loftware commands are used in command files to control label printing. Loftware Automation executes the commands within command files in top-to-bottom order. For more details, see section Command Files Specifications.

You can use specific custom commands if they are available in your Loftware Automation product in form of an action.

Example 96. Example

It is possible to the use the SETPRINTPARAM command if you can select the Set Print Parameter action.


Access to Network Shared Resources

This section defines best practice steps for using network shared resources.

  • User privileges for service mode. The execution component of Loftware Automation runs in service mode under a specified user account inheriting access privileges of that account. For Loftware Automation to be able to open label files and user printer drivers, the associated user account must have granted the same privileges. For more information, see section Running in Service Mode.

  • UNC notation for network shares. When accessing the file on a network drive, make sure you are using the UNC syntax (Universal Naming Convention), and not the mapped drive letters. UNC is a naming convention that specifies and maps network drives. Loftware Automation tries to replace the drive-letter syntax with UNC syntax automatically.

    Example 98. Example

    If a file is accessible as G:\Labels\label.nlbl, refer to it in UNC notation as \\server\share\Labels\label.nlbl (where G: drive is mapped to \\server\share).


  • Notation for accessing files in Control Center. If you open a file in Document Storage within Control Center, you can use HTTP notation such as http://servername:8080/label.nlbl, or WebDAV notation such as \\servername@8080\DavWWWRoot\label.nlbl.

    Additional notes:

    • User account under which the Loftware Automation service runs is also used to get files from Document Storage. This user must be configured in Control Center Configuration. This makes sure the user has access to the Document Storage files.

    • WebDAV access can only be used with Windows user authentication type in Control Center.

    [Note] Note

    The Document Storage is available with products LMS Enterprise and LMS Pro.

  • Printer drivers availability. To print labels to network shared printer, you will have to make the printer driver available on the server where Loftware Automation is installed on. Make sure the user account that Loftware Automation Service runs under has access to the printer driver. If the network printer was just installed on the machine, Loftware Automation might not see it until your restart the Service. To allow automatic notification of new network printer drivers, you have to enable the appropriate inbound rule in the Windows firewall. For more information, see the Knowledge Base article.

Losing your Label Cloud connection

If your Automation Manager is signed in to the Label Cloud, and you lose the internet connection, you must reestablish the connection in up to five days. Without reconnecting with your Label Cloud, Automation Manager closes automatically.

After losing the internet connection, and if your computer stays offline, a warning appears in 5 days. Automation Manager closes 5 minutes after you see the warning.

After you reestablish the internet connection, open Automation Builder or Automation Manager and sign in to Label Cloud. This makes your copy active again.

[Warning] Warning

Save your work to an offline location (your computer) to prevent losing any changes.

Printing to Cloud Printers

[Note] Note

Available with Loftware Cloud Business or higher editions.

You want to print your labels to your Cloud Printers that are enabled in your Control Center, but you don’t see Cloud Printers in your Automation Builder.

Cloud printers are accessible through Cloud Print API defined in your Developer Portal. See more about managing Cloud Printers on Loftware Help Portal.

To print your labels to Cloud Printers, run the action HTTP Request action in Automation.

  • In Connection Settings > Destination (IP address:port) enter your Cloud Printer address.

  • In the Requested method drop-down menu, select POST.

  • In Content > Data enter your JSON payload that defines your label file name and location, printing quantity, printer settings, and variable data. See more about JSON payload structure for Cloud Printers in Cloud Print API topic.

  • In ​Content​ > ​Type​ select ​application/json​​.

JSON Payload example:

Copy
{
  "deviceType": "CloudPrinter",
  "deviceId": {
    "printerName": "Warehouse_012B"
  },
  "filePath": "/PastaExport/PalletDRI.nlbl",
  "fileRevision": "",
  "labelName": "",
  "quantity": "1",
  "dataSources": [
    {
      "Country": "Italy",
      "Exp_date": "071229",
      "Prod_code": "77SOD239"
    }
  ]
}

Document Storage and Versioning of Configuration Files

Document Storage is a functionality of Loftware Control Center. It enables the Loftware Control Center to perform as a shared file repository on the server, in which users can store their files, retrieve them, and control their revisions.

Document Storage contextual tab enables you to perform document storage actions straight from Automation Builder. This makes accessing and opening the Automation file in Loftware Control Center unnecessary.

[Note] Note

This contextual tab requires connection with Loftware Control Center. LMS Enterprise license is mandatory for such configurations.

Revisioning group allows you to perform the available document storage actions:

  • Check Out: Checks out the file from Loftware Control Center document storage and makes it available for editing. The checked-out file is marked and locked for editing for any other user. All other users will see the current revision of the file, while the author already works on a new draft.

[Note] Note

After opening a document from the document storage (File > Open > Document Storage), the editing commands remain disabled until you check out the document.

  • Check In: Checks the file to Loftware Control Center document storage after the editing is done. When you check in the file, its revision number increments by one. The entered comment is added to file log.

  • Discard Checkout: Discards checkout of the current file and gives other users full access to the file.

    [Warning] Warning

    If you click Discard Checkout, all changes since the last file checkout will be lost.

  • Document Storage: Opens document storage location of the connected Loftware Control Center.

Accessing Databases

Whenever Loftware Automation needs to get data from a database, make sure that the necessary database driver is installed on the Windows system. Database drivers are provided by the company developing the database software. The driver that you install must match the bitness of your Windows system. Loftware software always runs in the bitness of your Windows system.

32-bit Windows

If you have 32-bit Windows, you can only install 32-bit database drivers. The same database driver is be used to configure the trigger in Automation Builder and to execute trigger execution in Loftware Automation Service. All Loftware Automation components run as 32-bit applications.

64-bit Windows

If you have 64-bit Windows, you can install 64-bit or 32-bit database drivers. The applications that are running in 64-bit use 64-bit database drivers. The applications that are running in 32-bit use 32-bit database drivers.

By default, Automation Service runs as 64-bit process. As such, it uses 64-bit database drivers to make a database connection. If 64-bit database drivers are not available on the system on which Automation Service is running, the database connection task offloads to the Loftware Proxy process. This process always runs as 32-bit process.

Automatic Font Replacement

You might design your label templates to print text objects using internal printer fonts. These are the fonts that are stored in your printer's memory. If you try to print such labels to a different kind or printer, the selected internal fonts might not be available. The new printer probably supports an entirely different set of internal fonts. The font layout might be similar in such case, but is available under a different name.

Font mismatch might also occur if the Truetype font that you are using on your labels is not installed on the computer on which you run Designer to design and print labels.

You can configure Designer to automatically replace the fonts used on the label with compatible fonts. I such case, Designer maps and replaces the fonts using their names. If the original font is not available, Designer uses the first available replacement font defined in the mapping table.

If there are no suitable replacement fonts, Designer uses the Arial Truetype font.

[Note] Note

After configuring font replacement, mapping rules execute when you change the printer for your label.

Automating Reports

Cloud_Business.png

Combine your business system data with labels containing Reports. Create reports in Loftware Designer and fill your reports with data from your business systems in LoftwareAutomation.

Your completed reports use your business system data to print. NiceLabel Automation:

  • Receives your business system data.

  • Parses your data with a data filter.

  • Populates your Report with parsed data.

  • Executes printing for your new populated reports with a trigger.

Creating temporary databases

You need to design your Reports before you automate them. To design reports, you need to connect them to a database.

If you use data from external business systems for reports, you have no database to work with. To work correctly, report data needs a hierarchical structure with clearly defined elements.

Create a temporary database with data from your business system (Usually XML or JSON data). With your temporary database, design and configure your reports. Your temporary database is only for setup. Configured reports print using Automation triggers, not your temporary database.

UUID-37136986-1bbf-336d-a921-0fa949f42863.png

Data from your business system with no hierarchy.

UUID-3f900745-e1a5-5ed3-e863-b3b6179a3aef.png

Data with hierarchy you can use to print reports.

UUID-bc42869d-c3a7-a5ef-e3e7-bb0930556865.png

Sample XML data you need to design reports (unparsed).

For you temporary database, create a CSV text database file. You have multiple options:

  1. Manually convert your data structure to a CSV text file:

    UUID-d5c7d971-643f-91ac-ea17-7b42ee7af04b.png

    Manually creating temporary CSV text databases.

  2. Use a common XML to Excel or XML to CSV conversion tool and manually format your data in a spreadsheet.

  3. Use an Automation data filter to automatically parse your data into a CSV text database.

Designing automated Reports

Open Designer to create your Report with your temporary CSV text database:

  1. Connect your temporary CSV text database to your Report.

  2. Design your report using your CSV text data as variables for objects in in your Repeater Definition.

    [Note] Note

    Match your variable names with data names in your data filter to map your data correctly.

    UUID-b74cb9bf-193f-cd7f-f56b-8c692193929b.png

    Designing reports with your temporary CSV text database.

Creating data filters

Create a data filter in Automation to use in your report (Refer to your included example trigger for more information on creating XML filters):

UUID-2154bab4-7f0a-875c-a010-27cd26cd8e66.png

Configuring your XML data filter.

Tips for creating data filters for reports:

  • You can use Structure Import Wizard to import your data structure.

  • Name your elements in data blocks of repeatable elements.

  • Set your elements as assignment areas or set sub-items as variables.

Creating triggers for your new data filter

[Note] Note

For your trigger to work, your data source names in Designer must match the data block field names in your data filter.

  • Include a Use Data Filter action to apply your data filter.

    UUID-8adcac97-da66-9ffb-1594-5edbe6c3d92e.png
    • Enable Collect records for report to collect all records in a table Automation uses to open your report labels.

      [Note] Note

      Use the same data structure names in your reports, triggers, and filters.

  • Include a Print Label action.

    UUID-68fd3beb-a876-5fbd-d724-6dbb20f1651e.png
    • Enable All (unlimited quantity).

Run your trigger. Your report now automatically updates with new data and prints with your trigger.

Changing Multi-threaded Printing Defaults

Cloud_Business.png

Every Loftware Automation product can take advantage of multiple processor cores – each core runs a print process independently. Half of the number of cores is used for processing concurrent normal threads, and the remaining half for processing concurrent session-print threads.

[Note] Note

Under normal circumstances, you never have to change the default settings. Make sure you know what you are doing when changing these defaults.

To modify the number of the concurrent print threads, do the following:

  1. Open file product.config in text editor.

    The file is located here:

    %PROGRAMDATA%\Loftware\Loftware\product.config

  2. Change the values for elements MaxConcurrentPrintProcesses and MaxConcurrentSessionPrintProcesses.

    <configuration>    <IntegrationService>        <MaxConcurrentPrintProcesses>1</MaxConcurrentPrintProcesses>        <MaxConcurrentSessionPrintProcesses>1</MaxConcurrentSessionPrintProcesses>    </IntegrationService></configuration>
  3. Save the file. Loftware Automation automatically updates the service with the new number of print threads.

Compatibility with NiceWatch Products

Loftware Automation allows you to load trigger configurations that were built using legacy NiceWatch products. In the majority of cases, you can run NiceWatch configuration using Loftware Automation without any modifications.

Loftware Automation products are using a new .NET based print engine optimized for performance and low memory footprint. The new print engine does not support each label design option that is available in the label designer. Each new release of Loftware Automation is closing the gap, but you might still come across certain unavailable features.

Controlling Automation Service with Command-line Parameters

Read this section to learn how to use command prompt to:

  • Start or stop Automation services.

  • Control which configurations are loaded.

  • Control which triggers are active.

[Note] Note

Make sure you are running Command Prompt in elevated mode (with administrative permissions). Right-click cmd.exe and select Run as Administrator.

Database Connection String Replacement

Configuration file for Automation Service can include database connection string replacement commands.

You can configure the service to replace certain parts of a connection string while the trigger is running. This enables a single instance of Automation to run the same configuration, but actually use a different database server for database related functionality. This allows the user to configure triggers in development environments and run them in production environments without any changes in the configuration.

Connection string replacement logic is defined in the DatabaseConnections.Config file that is located in the Automation system folder.

  1. Open the Automation system folder %PROGRAMDATA%\Loftware\Loftware

  2. Create a file with the name DatabaseConnections.config.

  3. Open the newly created file DatabaseConnections.config in a text editor and enter the sample content:

    <?xml version="1.0" encoding="UTF-8"?><DatabaseConnectionReplacements>    <Replacement>        <From>Data Source=mySQLServer</From>        <To>Data Source=NEW_mySQLServer</To>    </Replacement>    <Replacement>        <From>Initial Catalog=myDatabase</From>        <To>Initial Catalog=NEW_myDatabase</To>    </Replacement></DatabaseConnectionReplacements>

    This sample XML is an example, where an existing trigger contains a connection to the Microsoft SQL server named mySQLServer and the database named myDatabase. You want to update the connection string to use the database NEW_myDatabase on the server NEW_mySQLServer.

    Two replacement elements have to be defined – one to change the server name and one to change the database name.

  4. Check the existing connection string in your labels, then change the <Replacement> content with the correct values.

    Configuration file defines from-to pairs using its XML structure. The <Replacement> element contains one <From> and one <To> element. During trigger execution, the "from" string is replaced with the "to" string. You can define as many <Replacement> elements as necessary.

    [Note] Note

    Some connection strings use Server=servername while others use Data Source=servername. If you use the same database, you don't have to enter database names.

  5. Edit your product.config file that is located in %PROGRAMDATA%\Loftware\Loftware. Add the element /Common/General/UseLocalReplacementStrings and assign value True:

    <?xml version="1.0" encoding="utf-8"?><configuration>    <Common>        <General>        ...
                <UseLocalReplacementStrings>True</UseLocalReplacementStrings>        </General>    </Common>...
    </configuration>
  6. Restart both Automation services after adding or editing the config files.

  7. Repeat steps 1-6 on all computers that run Automation configurations where you want to replace database connection strings.

[Note] Note

Database connection string replacement does not change connection strings in your label files. This procedure just overrides connection strings when printing from Automation.

Entering Special Characters (Control Codes)

Special characters or control codes are binary characters that are not represented on the keyboard. You cannot type them the way normal characters are because they must be encoded using a special syntax. You would need to use such characters when communicating with serial-port devices, receiving data on TCP/IP port, or when working with binary files, such as print files.

There are two methods of entering special characters:

  • Enter the characters manually using one of the described syntax examples:

    • Use syntax <special_character_acronim>, such as <FF> for FormFeed, or <CR> for CarriageReturn, or <CR><LF> for newline.

    • Use syntax <#hex_code>, such as <#0D> (decimal 13) for CarriageReturn or <#00> for null character.

    For more information, see section List of Control Codes.

  • Insert the listed characters. Objects that support special characters as their content have an arrow button on their right side. The button contains a shortcut to all of the available special characters. When you select a character in the list, it is added to the content. For more information, see section Using Compound Values.

List of Control Codes

ASCII Code

Abbreviation

Description

1

SOH

Start of Heading

2

STX

Start of Text

3

ETX

End of Text

4

EOT

End of Transmission

5

ENQ

Inquiry

6

ACK

Acknowledgment

7

BEL

Bell

8

BS

Back Space

9

HT

Horizontal Tab

10

LF

Line Feed

11

VT

Vertical Tab

12

FF

Form Feed

13

CR

Carriage Return

14

SO

Shift Out

15

SI

Shift In

16

DLE

Data Link Escape

17

DC1

XON - Device Control 1

18

DC2

Device Control 2

19

DC3

XOFF - Device Control 3

20

DC4

Device Control 4

21

NAK

Negative Acknowledgment

22

SYN

Synchronous Idle

23

ETB

End Transmission Block

24

CAN

Cancel

25

EM

End of Medium

26

SUB

Substitute

27

ESC

Escape

28

FS

File Separator

29

GS

Group Separator

30

RS

Record Separator

31

US

Unit Separator

188

FNC1

Function Code 1

189

FNC2

Function Code 2

190

FNC3

Function Code 3

191

FNC4

Function Code 4

Licensing and Printer Usage

Depending on the license type, your Loftware product might be limited to a number of printers you can use simultaneously. In case of a multi-user license Loftware keeps track of the number and names of different printers you have used for printing on all Loftware clients in your environment. The unique printer identifier is a combination of printer driver name (not printer name), printer location and port.

"To use a printer" means that one of the below listed actions has been taken within the Automation configuration:

Each of these actions signalizes that a printer has been used. The associated printer is added to the list of used printers and remains listed for 7 days since last usage. To remove a printer from the list, do not use it for a period of 7 days and it will be removed automatically. The software displays the Last Used information so you know when the 7-day period passes for each printer. You can bind a printer seat to a specific printer by clicking the Reserved check box. Reservation ensures printer availability at all times – even if a printer has been idle for more than 7 days.

[Warning] Warning

If you exceed the number of seats defined by your license, the software enters the 30-day grace period. While in this mode, the number or allowed printers is temporarily increased to twice the number of printers allowed by license.

Grace period provides plenty of time to resolve licensing issues without any printing downtime or loss of ability to design labels. Exceeded number of allowed printers is usually an effect of printer replacement in your environment. It happens if old and new printers are used simultaneously, or if you add new printers. If you do not resolve license violation within the 30-day grace period, the number of available printers is reduced to the number of purchased seats starting with the last used printer on the list.

[Tip] Tip

To learn more about Loftware licensing, read the dedicated documentLoftware Licensing.

Running in Service Mode

Loftware Automation runs as a Windows service and is designed not to require any user intervention while processing data and executing actions. The service is configured to start when the operating system is booted and runs in the background for as long as Windows is running. Loftware Automation remembers the list of all loaded configurations and active triggers. The last-known state is automatically restored when the server restarts.

The service runs with privileges of the user account selected during the installation. The service inherits all access permissions of that user account, including access to network shared resources, such as network drives, and printer drivers. Use the account of an existing user with sufficient privileges, or even better, create a dedicated account just for Loftware Automation.

You can manage the service by launching the Services from Windows Control Panel. In a modern Windows operating system, you can also manage the services using Services tab in Windows Task Manager. You would use Services to execute tasks such as:

  • Starting and stopping the service.

  • Changing the account under which the service logs on.

Search Order for Requested Files

When loading a specified label or image file, Loftware Automation tries to locate the requested file on multiple predefined locations.

Loftware Automation locates the file in the following order:

  1. Check if the file exists on the location as specified by the action.

  2. Check if the file exists in the same folder as the configuration file (.MISX).

  3. Check if the label file exists in .\Labels folder (for graphic files check .\Graphics folder).

  4. Check if the label file exists in ..\Labels folder (for graphic files check ..\Graphics folder).

  5. Check if the file exists in the global Labels folder (Graphics folder for graphics files) as configured in the options.

If the file is not found on any of these locations, the action fails and the error is raised.

Securing Access to your Triggers

Certain deployments require secured access to the triggers. Loftware Automation allows you to enable security measures that grant trigger access only to trustworthy network devices. Security configuration depends on the trigger type. Some of the trigger types allow configuration of security access by design. For all triggers that are based on TCP/IP protocol, you can further define all details within the Windows Firewall.

Session Printing

Session printing enables printing of multiple labels using a single print job. If session printing is enabled, the printer receives, processes and prints all labels in the print job at once. As a result, printing speed increases due to continuous process of bundled label printing.

[Tip] Tip

Session printing serves as an alternative to the normally used non-session printing, during which each label is sent to a printer as a separate print job.

[Note] Note

Automation activates session printing automatically based on the configuration of actions.

Tips and Tricks for Using Variables in Actions

If using variables in Loftware Automation actions, follow these recommendations.

  • Enclose variables in parentheses. If you have variables with spaces in their names and refer to variables in actions, such as Execute SQL Statement or Execute Script, enclose the variables in parentheses, as in (Product Name). Also use parentheses if variable names are the same as reserved names, e.g. in the SQL Statement.

  • Place colon in front of the variable name. To refer to variables in Execute SQL Statement action or in Database Trigger, you have to place a colon (:) in front of the variable name, such as :(Product ID). The SQL parser understands it as 'variable value'.

    SELECT * FROM MyTable WHERE ID = :(ProductID)

  • Convert values to integer for computation. If you want to execute a numeric calculation with variables, make sure that you convert variable values to integers. Defining variables to be numeric only limits the acceptable characters for defining the value, but doesn't change the variable type. Loftware Automation treats all variables of string type. In VBScript, you would use the function CInt().

  • Set default / start up values for scripts. When using variables in actions, make sure these variables have some default value assigned, or the script checking might fail. You can define default values in variable properties, or in a script (and remove them after testing the script).

Tracing Mode

By default, Loftware Automation logs events into log database. This includes higher-level information gathering, such as:

  • action execution logging

  • filter execution logging

  • logging of trigger status updates

For more information, see section Event Logging Options.

However, default logging doesn't keep track of the deep under-the-hood executions. If troubleshooting is needed on the lower-level of the code execution, you must enable tracing mode. In this mode, Loftware Automation logs details about all internal executions that take place during trigger processing. Tracing mode should only be enabled during troubleshooting to collect logs and then disabled to resume normal operation.

[Warning] Warning

Tracing mode slows down processing. It should only be used when instructed so by Loftware technical support team.

After you reproduce the issue with enabled tracing, disable tracing in product.config file or restore your original product.config file.

            <Tracing>                <Enabled>False</Enabled>

Understanding Printer Settings and DEVMODE

[Note] Note

DEVMODE data structure is part of the GDI Print API structure in Windows. This section includes highly technical content, relevant only for specific requirements.

Whenever you print labels with Loftware software (or any document in Windows applications for that matter), the printing application reads printer settings as defined in the printer driver and applies them to the print job. The same label can be printed using different printers just by selecting another printer driver. Each time, printer settings of a newly selected printer apply to the label.

Printing a text document using two different laser printers usually produces the same or at least a comparable result. Printing labels using two different label printers can produce very inconsistent results. To produce comparable results, the same label file might require additional printer driver settings, such as adjustment of offsets, speed, and temperature of printing. Loftware also applies printer settings to every printout. By default, printer settings are saved inside the label file for the selected printer.

Using the Same User Account to Configure and Run Triggers

Loftware Automation Service always runs under credentials of the user account configured for the service. However, Automation Builder always runs under credentials of the currently logged-in user. The credentials of service account and currently logged-in account might be different.

While you can preview the trigger in Automation Builder without any issues, the Service might report an error message caused by credentials mismatch. While the currently logged-in user has permissions to access folders and printers, the user account that the Service uses might not.

You can test the execution of triggers in Automation Builder using the same credentials as Service does. To do so, run Automation Builder under the same user account as defined for the Service.

To run Automation Builder under a different user account, do the following:

  1. Press and hold Shift key, then right click the Automation Builder icon.

  2. Select Run as different user.

  3. Enter the credentials for the same user, as used in Loftware Automation Service.

  4. Click OK.

If you plan to frequently run Automation Builder under credentials of the other user account, see the Windows-provided command-line utility RUNAS. Use the switches /user to specify the user account, and /savecred. The latter allows you to enter the password only once, and then it is remembered for the next time.