Is a TCP Connection?
Ignition's UDP and TCP drivers allows Ignition to communicate to various devices like barcode scanners, scales, and more. 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.
The properties on the New Device page of the Gateway for the TCP and UDP devices are as follows:
|Name||Name of the device using this driver. This name will appear in the Devices folder when browsing the OPC-UA server.|
|Enables||When selected, the device is enabled. When not selected, disabled devices will not make a connection attempt.|
|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.
|Address||On the UDP driver, this is the IP address to listen to.|
On the TCP driver, this is the IP address to connect to.
|Inactivity Timeout||The number of milliseconds without receiving data from the source before a disconnect/reconnect is made. Set to 0 to disable.|
|Message Delimiter Type|
Sets the method used to determine how much or what data length constitutes a full message.
|Message Delimiter||If 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.
|Field Count||The 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 Delimiter||This 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.|
Both drivers have unique Advanced Properties
|Writeback Enabled||Enable writeback capabilities for the device.|
|Writeback Message Delimiter||The delimiter expected by the device signaling the end of an incoming message.|
|Message Buffer Size||The size of the message buffer in bytes.|
|Multicast||If 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.