LabeLase® Producer

Host Communications


Many tag-printing applications require that the data printed on the tags come from another computer called a host or from some other automation system. The host computer must be connected to the tag printing computer via some type of communications medium and using some type of communications protocol. The LabeLase® Printer software allows you to connect to another computer or network to enable the download of data to the printer.

 

Connection Type

You must select the physical medium to be used to connect the tag printer's PC to your host. You can select from network file transfer, TCP/IP or RS232-C serial port.

 

File Transfer

When the printer's PC is connected to your host computer via a network interface the file transfer connection type is the simplest and most reliable method of transferring the data and is recommended by InfoSight.   The host computer simply writes a file containing the data to a specific location on the printer's PC.   The Producer program will check for this file once every second and when it finds it, it will read its contents and then delete it.   The host must recreate the file the next time it wishes to send data.    Each record in the file is formatted to match the selected communications protocol. When using the File Transfer method, it is most common to select the Programmable Protocol.

You must chose a folder on the PC where you intend to write the data file, and you must also select the name of the file.   This pathname (which may include wildcard characters to specify groups of files) must be entered into the File Transfer field of the Host Communications Setup form.   Although it is not required that the file path be on the local PC, it is recommended since network problems would otherwise cause problems with the program's execution. If the file is located on a network resource, it is recommended that you use a UNC to specify the location rather than a Mapped Network Drive.

As the Producer program executes, it will check for this file's existence once each second.   The host must create this file in the proper folder (path) when it wishes to transfer data to the printer.   When the file is created, the Producer program will detect it and read its contents.   After reading all of the records from the file, the file will be deleted.   The host must recreate the file the next time it wishes to transfer data.

If the Producer program tries to read the file's contents while it is being written by the host, it will back off and try again a second later.   The host must ensure that the file is opened for exclusive write access while it is being created.

There is no imposed limit on the number of records that the host can put in the file.   However, the Producer program will read each entry into memory for processing, so the amount of available system memory may impose a practical limit.

 

Network TCP/IP Sockets

Modern personal computers often have an additional mechanism for connecting to other computers and that is a network interface.   Today, the Ethernet network medium is the most common form of network interface, although other network types such as WiFi are supported.

Once the computer is attached to the network, you must tell the Producer program what TCP port number it is to use to listen for connection request from your host system.  All port numbers less than 1025 are reserved, so pick a number between 1025 and 65535.   The program will default to 4000 and this is a good place to start.

Before you can make a connection to the Producer program, you must know the IP address of the computer.   An IP address can be static (that is, it is assigned to the computer by a network administrator and never changes) or it can by dynamic (it gets its IP address each time it boots up by asking a special server for one.)   For the network communications to function correctly, it is usually necessary to use a static IP address in your computer.   That way, your host system will know what the IP address is, and that it will never change.   You must see your network administrator before statically configuring an IP address in your computer.   Failure to follow this rule can result in duplicate address on the network and that is a BAD THING.

On your host system, you must write software that makes a call into the operating system to open a TCP connection.   You must specify the IP address of the PC as well as the port number you set in the Producer program's host setup form.   Once the connection is made, you must send data to the PC over that connection with another call into the OS.   The format of the data sent/received is as required by the application layer protocol that you have chosen (see below).   When the communications is completed, you can close the connection by another call into the OS.

RS232-C Serial Port

Some personal computers still have a communications port called an RS232-C port, although this is becoming less common.   This port provides a serial link to other computers, modems and printers that also have this type of port.   A serial port provides a one-to-one connection path between two devices only.  It is simple to connect and configure, but has limitations on the speed at which the devices may communicate.   The PC's operating system does not provide any low-level communications protocols or "stacks" for serial ports.   All of the communications must be implemented by the application software.

If you decide to use RS232-C as your connection type, you must provide a cable to connect your host system to the COM port on the PC.   You must also configure the port's settings to match those of the port on your host system.   This configuration is performed using the Producer program's Host Communications Setup form.

Using this form, you must choose a port on your PC that is not used for any other purpose.  The Producer program will open this port and keep it open for as long as it is running, so no other programs can have access to the port.

The Port pull-down will provide a list of COM ports available on your PC.   The list will not include the port that is currently assigned to communicating with the tag printer, because that port is not available.   The Producer program has no way of knowing if other programs on your PC will need access to the other ports, so it shows all ports that are installed, rather than ports that are available.

The Baud Rate, Data Bits, Stop Bits and Parity drop-down lists allow you to match the ports settings to that of your host system.   It is critical that both devices have the same port settings to avoid communications errors.

 

Miscellaneous Settings

The Producer program has additional settings that effect communications.

Automatically Print on Message Receipt - When checked, the printer will begin printing whenever it receives the proper message from your host system.   No additional command is required from you, nor will the operator be required to initiate the print.   When the data arrives, it is printed.

Queue Downloaded Messages - When checked, the data that is downloaded gets added to the job queue along with any other jobs that may be in the queue. If this feature is not checked, then whenever new data is downloaded, the job queue is cleared before adding the new job.

New Download Required to Print - When checked, a new download is required before the printer can begin printing.

Enable Host Status Monitor - Added in V3.1.0 - When checked, Producer will listen for connections on a TCP port defined below. See the section Host Status Monitor below for more details.

TCP/IP Listen at Port Number - Added in V3.1.0 - Defines the TCP port where Producer will listen for connections to the status monitor. Default is 20700. See the section Host Status Monitor below for more details.

 

Message Format Settings

Data Field Separator - This field specifies what character is used to separate the data fields in the download message.   Since one download message contains multiple fields of information, a character (or sequence of characters) is required to separate them.   The default for this field separator is the comma character and that will be sufficient for most applications.   However, if it is possible that one of your data fields can contain a comma character within it, then you must select a different character to use as the separator.

Fixed Fields - The Standard Message Format (below) can begin with three fields for filename, quantity and copy count.   If your download does not have these fields, and cannot substitute the empty placeholders for these fields to use the default settings, you may exclude them from the message with these settings.   Each of the three fields can be independently included by checking its associated checkbox.   If a field is excluded, be sure not to include it, even if it is blank, in your download.

Default Layout - You may optionally specify the full path and file name for the layout to be used by the downloaded data. If your download does not include the layout filename, then indicate the layout file to use by default.

 

Standard Message Format

You can use one of several different communications protocols (described below) to communicate with the Producer program, but the format of the data that is encapsulated by the protocol is generally the same (note that this does not apply for the PPE protocol, or the Programmable protocol with fixed fields selected.)   We call this the Standard Message Format and it is defined as follows.

The Standard Message Format consists of several fields of information, each separated from the others by a separator character (or sequence of characters) that you specify in the Data Field Separator in the Host Communications form.   This separator is typically the comma or tab character.  The format is defined below:

<FILENAME>,<QUANTITY>,<COPIES>,<FIELD1>,<FIELD2>,...<FIELD N>

The first field of the message is optional and specifies the layout file name.   This filename can be a fully qualified path name specifying a tag layout file on the local disk drive, a floppy drive, or any network path.  The filename can also be just the file name portion, without the path information but this is not recommended.   If you omit the path, the program will first look for the file in the folder that was last used by the operator to open a file.  If the file cannot be found there, it will then look in the folder that contains the Producer program.   If you do not want to specify a layout file to open, and instead want to use the default layout, simply omit the filename field (you must still include the separator character) and enter the full path and file name of the layout.

The second field is optional and is the quantity of tags to print.   This is the same value that the operator can enter on the main form.

The third field is optional and is the number of copies of each tag.   This is the same value that the operator can enter on the main form.

The remaining fields are text data that will be placed into the operator data entry fields for the layout.   You may send as many fields as there are operator data entry fields in the layout.   If you wish to clear a particular field, simply omit the data (you must still include the separator character.) 

An example of the Standard Message Format is shown below.   The Data Separator character is set to the comma.

c:\layoutfiles\stainlesslayout.itl,1,1,A2398,123,Stainless

This message will cause the Producer program to load the layout called "stainlesslayout.itl" from the specified folder.   It will set the quantity and copy count both to 1.   It will set the first operator data entry field to "A2398", the second field to "123" and the third field to "Stainless".   If there are additional operator data entry fields in the layout, these will be unaffected.

Binary Values in the Data Separator - It may be necessary to specify a binary or control code value as part of the data separator field.  For example, the download may use a TAB character, record separator (RS), carriage return (CR) or other non-printable ASCII character between the data fields. To include these values, you may specify the value in one of the following ways:

  • Specify the hexadecimal value directly using the following format:  \x09 
  • Use a common "escape" sequence: \r = carriage return, \n = line feed,  \t = tab.
  • Use the standard ASCII control code name: \<TAB>   \<CR>   <\RS>
  • Do not specify Unicode characters in this manner. This is reserved for the ASCII control codes only. All Unicode characters MUST be encoded as UTF-8

Communications Protocol

Regardless of whether you are using a Serial COM port or an Ethernet network as your means of connecting to the tag printer PC, you must still use a communications protocol to communicate.  Although TCP/IP provides the basic connection level protocol, the application protocol "rides on top of" TCP.

LabeLase® Producer provides several application protocols that you can use to connect your host system to the tag printer.    Each of these protocols have their own advantages and disadvantages in areas such as ease of implementation, reliability, security, etc.

Below, we will discuss each of these protocols and how they may be used.

Programmable

The "programmable" protocol is not really a protocol as such.   It is instead a mechanism for implementing simple communications between your host system and the Producer program.   You have the ability to customize the message format, reply, etc.

There are actually two ways to use the programmable protocol:  Fixed fields, and Standard Message Format.

Fixed Fields - When you enable this feature, you must download the data in a rigid format where all the data fields are always the exact same length and in the same order.   You may still include the filename, quantity and copies data in the download, but they must always be the same length and in the same position.   The program extracts the fields by counting characters as you specify in the Fixed Field Positions table of the setup form.   This method is most useful when you are replacing an existing printer from another manufacturer and you don't want to change your download format.

Standard Message Format - When Fixed Fields is disabled, you must send the message data in the Standard Message Format as previously described.

 

InfoSight Extended

The Extended protocol is unique to products from InfoSight Corporation and is available in all of its marking products.   The protocol is a master-slave interface, with your host system acting in the role of master.  This means that all transactions are initiated by your system, and the printer will only respond "when spoken to".   You will never receive an unexpected message from the printer.   Details of the Extended Protocol are available in this document on the InfoSight website.

The Extended Protocol uses a message type field to identify the contents of each message.   Several message types are defined for the LabeLase® Producer program, but the most important one is the "Download" message.

The Download message is identified by message type 'D'.   The data text field of the message consists of the Standard Message Format.   An example is shown below:

<SOH> D <STX>stainlesslayout.itl,1,1,A2398,123,Stainless<ETX><BCC><CR>

(note that the block check, BCC, is shown symbolically here.)

The Producer program will reply with the following message

<SOH> D <STX><ETX><BCC><CR>

Each time you send a message of this type, the data will be added to the data queue (see Data Buffering below.)

Other message types are also available:

Type 'C' - Communications check.  There is no data in the reply message.

Type 'G' - Print a tag

Type 'A' - Load a tag layout.  The data field of your message must contain the filename.

Type 'H' - Feed a tag

Types '1' through '0' - The data field contains text for the operator data entry field specified by the message type.   Type '0' indicates the tenth field.

Please note that types 'G', 'H', 'A', and '1' through '0' act asynchronously to the message buffer.  You should not mix these message types with the 'D' message type unless the message queue is disabled in setup or unpredictable behavior will result.

Message type 'S' allows the host to query the printer for its status.  Producer will reply to this message with the status codes in the data text field.   The format of the reply message is:

#,#,#,#,#

where each number represents a printer status field.   The fields are defined as

MODE, STATE, FAULT, PRINTER COM, TAGS

 

MODE Value
Unknown 0
Estop 1
Online 2

 

STATE Value
Idle 0
Printing 1
Feeding 2

 

FAULT Value
No Fault 0
Feed Fault 1
Printer COM Fault 2
Estop Abort 3
Out of Tags 4
Command (Operator) Abort 5
Timeout Abort 6
Reset (from printer) Abort 7
Printer Abort 8
Vector Out of Tags 9
Unspecified Abort 10

 

PRINTER COM Value
OK 0
NAK 1
SOH Error 2
TYPE Error 3
Message ID Error 4
STX Error 5
ETX Error 6
BCC Error 7
Timeout 8
Message Length Error 9
Generic COM Error 10
COM Disabled 11

 

TAGS Value
Out of Tags 0
Tags Loaded 1

 

The following message types allow the host to better control the operation of the tag printer.   These messages and their formats are shown below:

Type 'M' - Move the tag.   The data text field of this message contains a signed floating point value that indicates the direction and distance to move the tag material.   Negative numbers move the tag material back into the printer, while positive numbers move the tag out of the printer.

Type 'R' - Reverse Feed the tag.   This message will cause the tag to be reverse fed back into the printer.

Type 'T' - Feed to Tearoff.   This message will cause the tag material to be fed until the tag's notch is at the tearoff location.

Type 'X' - Disable Auto Tearoff After Print.  This message will temporarily disable the printers automatic feed to the tearoff location after printing the tag.   Note that this setting is not saved when the Producer program terminates, so it is recommended that you send it before each print cycle.

Type 'Y' - Enable Auto Tearoff After Print.  This is the opposite to message type 'X' and is used to re-enable the automatic feed to tearoff after printing.

Please note that types 'M', 'R', 'T', 'X' and 'Y' act asynchronously to the message buffer.  You should not mix these message types with the 'D' message type unless the message queue is disabled in setup or unpredictable behavior will result.

 

PPE

The Pannier Protocol Emulator is designed to emulate the communications protocol of printers from the Pannier Corporation.   This protocol should allow you to connect the LabeLase® tag printer to the same download as a Pannier printer without modification.

Note that the Pannier protocol uses a special command to signify a "buffer" or layout change.  This command is the letter O (oh) followed by a single digit that is the buffer number.   When the emulator encounters this sequence, it will attempt to load a layout whose name is that single digit (e.g. 1.itl)

Note also that you cannot specify a quantity or count value with this emulator.

Please note that the emulator works for many Pannier installations, but it is not foolproof.   Your Pannier printer may have custom software that implements non-standard commands that our emulator cannot decode.   If this is the case, contact the factory to investigate custom software for your LabeLase® printer to implement these non-standard features.

 

IPL

The Intermec Programming Language is used by thermal label printers manufactured by the Intermec Technologies Corporation.   Selecting this protocol allows the LabeLase® Producer software to accept a data stream intended for an Intermec printer.   Note that only the data fields are extracted from the download and not the label format information.

 

ZPL

The Zebra Programming Language is used by thermal label printers manufactured by the Zebra Technologies. Selecting this protocol allows the LabeLase® Producer software to accept a data stream intended for a Zebra printer.   Note that only the data fields are extracted from the download and not the label format information.

 

XML

The XML protocol is actually a data format that includes the ability to send an entire tag layout to the printer. The data is formatted in XML (Extensible Markup Language) to match the InfoSight LabeLase® Producer XML File Format.

The easiest way to send a layout file as XML is to create the layout using LabeLase® Designer and use the .itlx file as a template. These files are stored natively as XML.

 

Unicode

LabeLase® Producer version 2.x and later fully supports Unicode. Unicode is a standard for encoding and representing text in most of the world's writing systems. With Unicode compatibility, Producer can accept and print characters from around the world.

To download data in Unicode you must encode it as UTF-8. UTF-8 is a character encoding capable of encoding all of the Unicode code points. UTF-8 is variable length and uses 8-bit code units. UTF-8 is backward compatible with ASCII.

More information on Unicode and UTF-8 is available on Wikipedia.

Note that although Producer can accept Unicode code points encoded as UTF-8, when it prints those characters on a tag the selected font must support those characters. Not all fonts are Unicode compatible, and not all Unicode fonts support all code points.

Host Status Monitor

LabeLase® Producer version 3.1.x and later supports the ability for an external device to connect via TCP sockets and receive status update messages asynchronously from Producer.

Producer will listen for connection requests on the status monitor port (configurable, default = 20700). A printer must be configured and enabled in Producer in order for the host to connect to these ports.

Note that each connected must listen at a different TCP port number.

An external device must make a connection request on the desired port and wait for the socket to be established. As soon as the socket is connected Producer will send a status update message. Every time there is a change in one of the status fields, a new message will be sent.

The connected host can request a status update at any time by sending any character to Producer.

Status messages are sent in JSON format. An example of the JSON message sent by Producer is shown below

{"labelase-producer": {
"timestamp": 44474.430820,
"version": "3.1.0.300",
"id": 1,
"model": "LL4100",
"sn": 1234,
"firmware": "4/09/19, 2.30",
"counter": 5,
"mode": "Online",
"state": "Idle",
"fault": 0,
"comm": "OK",
"tags": "Loaded",
"cycletime": 2.34
}}

FieldExampleDescription
object namelabelase-producerThe name of the JSON object
timestamp44474.430820A time stamp of the transmission. The integral part is number of days since December 30, 1899. The fractional part is the time of day.
version3.1.0.300Version of Producer
id1Connected printer ID number (1-4)
modelLL4100Connected printer model
sn1234Connected printer serial number
firmware4/19/19, 2.30Date and version of the printer's firmware
counter5Number of print cycles the printer has completed
modeOnlinePrinter mode ('Unknown', 'EStop', 'Online')
stateIdlePrinter state ('Idle', 'Printing', 'Feeding')
fault0Fault code (see Extended Protocol for possible fault codes)
commOKPrinter communications status (see Extended Protocol for possible comm states)
tagsLoadedTags are either 'Loaded' or 'Out'
cycletime2.34Time for the most recent print cycle in seconds

 

Copyright © 2021 InfoSight Corporation All Rights Reserved
InfoSight® is a registered trademark of InfoSight Corporation