To learn more about triggers in general, see section Understanding Triggers.
TCP/IP server trigger event occurs after the monitored socket (IP address and port number) receives data.
Typical usage: An existing business system executes a transaction, which in effect sends the data to NiceLabel Automation server on a specific socket. Data content might be structured using CSV, XML and other formats, or it might use a legacy format. In either way, NiceLabel Automation reads the data, parses values using filters and prints them on labels. For more information on how to parse and extract the data, see section Understanding Filters.
General
This section allows you to configure the most important file trigger settings.
-
Name: Specifies the unique name of the trigger. The names helps you distinguish between different triggers when you configure them in Automation Builder, and later when you run them in Automation Manager.
-
Description: Allows you to describe the role of this trigger. Help the users with a short explanation about what the trigger does.
-
Port: Specifies the port number where incoming data will be accepted on. Use the port number that is not in use by any other application. If the selected port is in use, you won't be able to start the trigger in Automation Manager. For more information about security concerns, see section Securing Access to your Triggers.
Note
If your server has multi-homing enabled (more IP addresses on one or more network cards), NiceLabel Automation responds on the defined port on all IP addresses.
-
Maximum number of concurrent connections: Specifies the maximum number of accepted connections. That many concurrent clients can send data to the trigger simultaneously.
The options in the Execution Event section specify when the trigger should fire and start executing actions.
-
On client disconnect: Specifies that the trigger fires after the client sends data and closes the connection. This is a default setting.
Note
If you want to send the print job status back to the third party application as a feedback, don't use this option. If the connection is left open, you can send feedback using the action Send data to TCP/IP port with the parameter Reply to sender.
-
On number of characters received: Specifies that trigger fires when the required number of characters is received. In this case, the third party application can keep a connection open and continuously sends data. Each chunk of data must be of the same size.
-
On sequence of characters received: Specifies that the trigger fires each time the required sequence of characters is received. You would use this option if you know that the 'end of data' is always identified by a unique set of characters. You can insert special (binary) characters using the button next to the edit field.
-
Include in trigger data: The sequence of characters that determines the trigger event is not stripped of the data, but is included along with the data. The trigger receives the complete received data stream.
-
-
When nothing is received after the specified time interval: Specifies that the trigger fires after a required time interval passes since the last character is received.
Execution
-
Allow connections from the following hosts: Specifies the list of IP addresses or host names of the computers that are allowed to connect to the trigger. Place each entry in a new line.
-
Deny connections from the following hosts: Specifies the list of IP addresses or host names of the computers that are not allowed to connect to the trigger. Place each entry in a new line.
-
Welcome message: Specifies a text message that returns to the client each time it connects to the TCP/IP trigger.
-
Answer message: Specifies the text message that returns to the client each time the actions execute. Use this option when the client doesn't disconnect upon data send and expects the answer about when the action execution ends. The answer message is hard-coded and thus always the same.
-
Message encoding: Specifies the data encoding scheme, so the special characters can be correctly processed. NiceLabel Automation can automatically detect the data encoding, based on BOM header (text files), or encoding attribute (XML files).
Other
Options in the Feedback from the Print Engine section specify communication parameters that allow you to receive print engine feedback.
-
Supervised printing: Activates synchronous printing mode. Use it whenever you want to send the print job status back to the third party application. For more information, see section Synchronous Print Mode.
Options in the Data Processing section specify if you want to trim the data so that it fits into a variable, or ignore the missing label variables. By default, reports errors and breaks the printing process if you try to save values that are too long in label variables, or try to set values for non-existing label variables.
-
Ignore excessive variable contents: truncates data values that exceed the length of the variable as defined in the label designer to make them fit. This option is in effect if you are setting variable values in filters, from command files, and when you are setting values of trigger variables to label variables of the same name.
Example 22. Example
Label variable accepts 5 characters at maximum. With this option enabled, any value longer than 5 characters is truncated to the first 5 characters. If the value is 1234567 ignores digits 6 and 7.
-
Ignore missing label variables: When printing with command files (such as JOB file), the printing process ignores all variables that are:
-
specified in the command file (using the SET command)
-
not defined on the label
Similar happens if you define assignment area in a filter to extract all name-value pairs, but your label contains fewer variables.
When setting values of non-existing label variables, reports an error. If this option is enabled, the printing continues.
-
Options in Scripting section specify scripting possibilities.
-
Scripting language: Selects scripting language for the trigger. All Execute script actions that you use within a single trigger use the selected scripting language.
Options in the Save Received Data section specify the available commands for data that the trigger receives.
-
Save data received by the trigger to file: Enable this option to save the data received by the trigger. The option Variable enables variable file name. Select a variable that contains path and file name.
-
On error save data received by the trigger to file: Enable this option to save the data into the trigger only if an error occurs during the action execution. You might want to enable this option to keep the data that caused the issue ready for troubleshooting.
Note
Make sure you enable the Supervised printing support. If not, Automation cannot detect errors during the execution. For more information, see section Synchronous Print Mode.
Note
Automation saves the received data into a temporary file. This temporary file is deleted right after the trigger execution completes. The internal variable
DataFileName
points to that file name. For more information, see Internal Variables.
Security
-
Lock and encrypt trigger: Enables trigger protection. If you enable it, the trigger becomes locked and you cannot edit it any longer. This encrypts the actions. Only users with password can unlock the trigger and modify it.
Sending keepalive signals
Your network routing system can silently drop your connection when there is no TCP/IP traffic for a few minutes. To avoid being disconnected, you can choose to periodically send keepalive signals in NiceLabel Automation.
Enable sending keepalive signals in your product.config
file:
-
Navigate to the System folder.
%PROGRAMDATA%\NiceLabel\NiceLabel 10
-
Make a backup copy of the
product.config
file. -
Open
product.config
in a text editor. The file has an XML structure. -
Add the following lines:
<configuration> <IntegrationService> <KeepAliveTime>60000</KeepAliveTime> <KeepAliveInterval>10000</KeepAliveInterval> </IntegrationService> </configuration>
Note
KeepAliveTime
(in milliseconds): Specifies how long the TCP socket connection must be inactive before Automation sends a keepalive signal and waits for the acknowledge packets to be returned.KeepAliveInterval
(in milliseconds): Specifies at what intervals to send anotherkeepalive packet when the host is not returning any acknowledge packets.When the TCP/IP trigger receives the keep alive packet and returns the acknowledge packet, the
KeepAliveTime
timer starts again.Both values (
KeepAliveTime
andKeepAliveInterval
) are mandatory to enable sending keepalive signals and must have values larger than 0. -
Save the
product.config
file. -
Restart your Automation service.
Enabled keepalive signals now keep your connection active.