Skip to main content
Version: 8.1

UDP and TCP Driver

Ignition's UDP and TCP drivers allows Ignition to communicate to various devices like barcode scanners, and scales. These are not catch-all drivers that will talk to any PLC that communicates over TCP, but rather very basic drivers that will communicate over TCP or UDP. The drivers are configured to connect to one or more ports on a given IP address and bring in any data there (ASCII characters, etc) as a value of a tag. Both drivers can act as strictly passive listeners: meaning they do not write back or make any requests to the device. This is very powerful for the devices that are designed to function in this way (like barcode scanners) because the device just needs to constantly update data on a port for this driver to work.

The TCP driver has the option of writing back to the device. When configured for Writeback, a tag is exposed in Ignition's OPC server that will handle writing: any writes made to the tag are sent to the device.

Structure in the Address Space​

A device using the UDP or TCP driver appears in the Devices folder of the OPC-UA server with the name it was configured to use. Browsing the device will yield one folder per port configured to listen on. Browsing the port folder will yield one variable node containing the entire message received as well as an additional variable node per field configured. A device configured with a field count of four would have five nodes total: one for the message and four for the fields.

Connecting to a Device​

Inductive University

Connecting to TCP Device

Watch the video

Instead of connecting to a device directly, this driver will connect to a port (often on the host computer or a computer connected directly to the device), and that device will be configured to post data to that same host/port. Rules are configured that dictate how the incoming data is interpreted. You can configure multiple ports for each device connection.

Connect to a Barcode Scanner or Scale​

You can connect to a barcode scanner or scale by using Ignition's UDP and TCP driver.

  1. Go to the Config section of the Gateway Webpage.

  2. Scroll down and select OPC UA > Device Connections.

  3. On the Devices page, click on Create new Device.

  4. On the Add Device Step 1: Choose Type page, scroll all the way down and select TCP Driver, and click Next.

  5. On the New Device page, leave all the default values and type in the following fields.

    • Name: The name you specify here will appear under the Devices folder on the Quick Client page in the Gateway.
    • Port(s): 12345, as an example
    • Address: type the IP address, for example 10.20.3.456

    Connect to a Barcode Scanner or Scale Step 5

  6. You can check the box for Show advanced properties? to see the additional settings, but you can keep all the defaults.

  7. Click Create New Device. The Devices page is displayed showing the Scale device is successfully created and added to Ignition. The Status will show as 1/1 Connected.

  8. Go to the OPC Connections > Quick Client in the Config section of the Gateway Webpage.

  9. Under the Devices > [Scale] > 12345 folder you will see the Last Receive Time and the Message folders. Next to each tag, under the Action column, you will see [s][r][w].

  10. Click on [s], which means Subscription. You will be able to see the Value of the tag displayed on this OPC Quick Client page.

Device Properties​

The properties on the New Device page of the Gateway for the TCP and UDP devices are as follows:

General​

PropertyDescription
NameName of the device using this driver. This name will appear in the Devices folder when browsing the OPC UA server.
EnablesWhen selected, the device is enabled. When not selected, disabled devices will not make a connection attempt.

Connectivity​

PropertyDescription
Port(s)On the UDP driver, this is the port(s) to listen on. On the TCP driver, this is the port(s) to connect to. Separate multiple ports with a comma.
AddressOn the UDP driver, this is the IP address to listen to. On the TCP driver, this is the IP address to connect to.
Local Address​
New in 8.1.8
The local address to connect from when establishing a TCP connection. If left blank, then the driver will simply pick an available address.
Connect Timeout​
New in 8.1.17
The timeout, in milliseconds, when opening a socket connection to a remote host. Set to 0 to disable.
Inactivity TimeoutThe number of milliseconds without receiving data from the source before a disconnect/reconnect is made. Set to 0 to disable.

Message​

PropertyDescription
Message Delimiter TypeSets the method used to determine how much or what data length constitutes a full message.
  • Packet Based: Assumes that whatever arrives in one packet, regardless if length or content, is the message.
  • Character Based: Content is appended to a message buffer until the given character or set of characters arrives, at which point the contents of the buffer are considered the message.
  • Fixed Size: Content is appended to a message buffer until some fixed number of bytes is received, at which point the contents of the buffer are considered the message.
Message DelimiterIf the message delimiter type is Character Based, this will be the character or set of characters used to identify a message. If the type is Fixed Size, this will be the size used to identify a message.
If using Character Based, see Message Delimiters below.
Field CountThe number of fields within a message must be fixed. This property dictates how many fields will be present in each message. When the number of fields received does not match the designated count, all nodes will receive quality BAD_CONFIG_ERROR.
Field DelimiterThis is the character(s) that are used as field delimiters. For example, the message a|b|c|d with a field delimiter of "|" would be split into four fields: a, b, c, and d. The field count would have to be set at 4.

Advanced​

Both drivers have unique Advanced Properties.

TCP Driver​

PropertyDescription
Write Timeout​
New in 8.1.24
Duration, in milliseconds, to wait for writes to complete before returning. The default time is 5 seconds.
Writeback EnabledEnable writeback capabilities for the device.
Writeback Message DelimiterThe delimiter expected by the device signaling the end of the incoming message. See Message Delimiters below.

UDP Driver​

PropertyDescription
Message Buffer SizeThe size of the message buffer in bytes.
MulticastIf the connection should be enabled for multicast.
Tag Polling Speed

Tag values update no faster than the scan class a tag is assigned to. If additional messages are received over TCP or UDP at a faster rate, the tag will not show these additional values. Generally it is recommended to use these drivers with updates that come through at a 1 second rate or slower. The absolute maximum rate for the TCP driver is 25ms, although most systems cannot reliably execute this quickly. The UDP driver does not have a maximum rate, but a practical maximum rate will depend on hardware, and likely will be significantly slower than 25ms as well. Most "fast" scan rates fall in the 100ms-200ms range.

Message Delimiters​

A couple of properties allow you to specify a message delimiter. Some devices may be expecting a control character of some sort, such as a carriage return. The table below lists characters that you can enter into a message delimiter property to signify certain control characters.

CharactersDescription
\ttab
\bbackspace
\nnewline
\rcarriage return
\fform feed

UDP and TCP Device Tags​

When configured, both drivers have explicit sets of tags they use to communicate. The tags are listed below.

TCP Tags​

NameDescription
Last Receive TimeA datetime representing when the last message was received.
MessageA string interpretation of the last received message.
MessageBytes​
New in 8.1.2
A binary representation of the last received message.
WriteableOnly available when the TCP device connection has Writeback Enabled. Writing to this tag from Ignition will send a write request to the device. The content will be sent as a string.
WritableBytes​
New in 8.1.2
Only available when the TCP device connection has Writeback Enabled. Writing to this Tag from Ignition will send a write request to the device. The content will be sent as binary data.

UDP Tags​

NameDescription
Last Receive TimeA datetime representing when the last message was received.
MessageA string interpretation of the last received message.
MessageBytes​
New in 8.1.2
A binary representation of the last received message.