[00:00]
There are a lot of devices that output ASCII over the network or over TCP, such as barcode scanners and scales. To read these values in Ignition, we can use the built-in TCP and UDP drivers. These drivers are essentially passive listeners on the network that read these packets, possibly parse them out and then display them as tags. If we wanted to set up these types of device connections, we first need to go to the device connections page in the configure section of our gateway. Here, we can click on the create new device link and scroll all the way down to the bottom where we'll find the TCP and UDP drivers. You're going to select the appropriate driver for whatever your device uses. I'm going to select the TCP driver and then we'll click on next. We're going to want to give a name to our device. I'm just going to call mine scale. Then we can scroll down to the connectivity section where we'll find a port and address.
[01:04]
We're going to want to put the port that we're communicating over. For me, it's 5,000. For address, we want to specify the IP address to connect to. In my case, I'm using local host. We can then scroll down a little further to the message section. Here we can set up the type of message delimiter we're going to use. The first is packet based, where the driver will assume that each packet is one entire message, and then wwill turn that entire packet into a single tag. The second type of message delimiter is character based. With character based message delimiters, It's going to be looking for a specific character that you would specify in the message delimiter property. Finally, the last type is fixed size, which will use a fixed amount of characters specified in the message delimiter property as well to determine when the end of the message is. I'm going to keep mine at packet based. There's also a field count and field delimiter where you can set up the number of fields in a message.
[02:02]
It's important to note that the number of fields in your message must match the number of fields specified here in the field count property, or else your message will throw an error. Finally, if we take a look at these advanced properties by clicking the show advanced properties checkbox, you'll notice that the TCP driver has the ability to write back. This can be useful for certain devices and you simply click the checkbox to enable it and then put the delimiter in the write back message delimiter property. I'm going to leave mine blank and go ahead and click the create new device button at the bottom. You should be able to tell right away if you have a successful connection. You'll notice that mine says one out of one connected. If we wanted to take a quick look at the tags that we get from the TCP driver, we can go ahead and scroll down and go to the quick client down under OPC Connections. We'll expand our OPC UA server and find my scale device. Here you'll find the port number that our device is located at. You'll have some tags here, including a message tag. My scale currently has a value of five, so if I were to subscribe to that tag and take a look at it, we see here that we have a value of five.
[03:10]
If I were to adjust the weight on the scale to say 15.2, we can see we now get a value of 15.2 in our tag.