You can help by commenting or suggesting your edit directly into the transcript. We'll review any changes before posting them. All comments are completely anonymous. For any comments that need a reply, consider emailing email@example.com.
We are experiencing playback issues from our video hosting provider. Please check back shortly.
Connecting to TCP Device
Learn how to connect to a barcode scanner or scale using Ignition's UDP and TCP driver.
Video recorded using: Ignition 7.9
Transcript(open in window)
[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 devices page in the configure section of our gateway webpage. 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. We're going to want to give a name to our device. I'm just going to call mine scale. Then we can scroll a ways to the connectivity section, where we'll find a port and address. For port, we're going to want to put the port that we're communicating over. For me, it's 49883. Then the address is the IP address of the device. Mine is located locally, so I'm just going to put 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 will 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. 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 the 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. 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 two tags, a last received time, and a message. My scale currently has a value of three, so if I were to subscribe to that tag, and take a look at it, we see here that we have a value of three. If I were adjust the weight on the scale to, say, 15.2, we can see we now get a value of 15.2 in our tag.