Blogs Technology Integration with Kepserver U-CON

Technology Integration with Kepserver U-CON

August 23, 2023

Blog article originally written by Joanne Bacharach

What is technology integration?

Consider the following situation. You are in the manufacturing automation world or on the plant floor. You have unwrapped the new barcode scanner, wireless temperature sensor, or weigh scale that is meant to make your life easier and your process oh-so-much better. You crack open the manual to get started. After an hour or so of reading and installing some proprietary software provided by the vendor, you realize there is no easy way to get the data into your existing automation systems.

Having no fear, you reference Google and other tools like Wireshark for help. Let’s take that temperature sensor as an example: after a quick Wireshark of the temperature and humidity readings being broadcast over UDP, you discover that each data packet is simple human-readable ASCII. If only you could parse that ASCII out into data tags!

A Wireshark of the temperature and humidity readings being broadcast over UDP.

Instead of learning how to get this device to hook into systems you have, you are even more confounded. You're having no luck searching for a software application that can easily grab the ASCII data, parse it, and send it to your existing OPC-based applications or other industrial automation systems. Since you're not a programmer, you're unable to write this application yourself, either. You feel somewhat stumped.

What is the U-CON driver for Kepware Server?

Enter the User Configurable (U-CON) driver for KEPServerEX. U-CON was created for just this situation, where no pre-defined driver already exists and the data protocol is easily interpreted (or if you are lucky, the vendor provides you with thorough protocol documentation). This driver puts power in the hands of the user to define a custom driver.

But what if you have no idea where to begin programming your own driver? U-CON is not programming in the true sense; you do not need to know C++ or another language to do it. U-CON simply gives you a list of commands to choose from and—with a little trial and error—you can quickly create your own driver. U-CON also takes care of the transport layer, which means you do not need to worry about establishing a TCP socket or connecting to a serial COM port. All you need to do is:

  • Tell U-CON what to send over the wire in the data packet to the device

  • Tell U-CON how to parse the data packet being returned from the device

U-CON takes care of all the higher-level transport layer stuff itself.

How to use the Kepware U-CON driver for technology integration

We have now walked through a common situation where there is no “out-of-the-box” solution available for connecting a device into an existing automation system. Now, I’m going to demonstrate how you can create a custom driver with Kepware’s User Configurable (U-CON) driver.

Step 1

To start, get your hands on some protocol documentation or Wireshark captures of the device data. Before you begin developing a U-CON profile, it is important to know if the data protocol you’re working with is in a format that can be dissected and understood. In the example from the previous section, the sensor is sending ASCII data with temperature and humidity readings over Wi-Fi to a UDP port. 

In the same example as before, the sensor is sending ASCII data with temperature and humidity readings over WiFi to a UDP port.

Because the data is not encrypted and is human-readable, it is easy to know where the values for temperature and humidity are contained in the data packet in order to parse that data into tags in KEPServerEX (where it can be read by any connected application). It would be even better to have the protocol documentation from the vendor, along with a list of commands and responses that may be used when communicating with a device.

Note that if the data is encrypted (and there is no way for you to decrypt it) and the vendor refuses or is unable to provide any protocol documentation, then U-CON is not a viable option for you.

Step 2

Open the KEPServerEX Configuration window and create a new channel. In Device Driver, select U-CON (user-configurable) and then continue through the wizard. In Communications, if you are using an Ethernet connection, be sure to select the correct mode: Solicited or Unsolicited.

If you are using an Ethernet connection, be sure to select the correct mode: Solicited or Unsolicited.

  • Solicited mode means the device is expecting KEPServerEX to establish the connection and send some type of request to start communications. For example, in Modbus, the slave device expects the master to send a function code “03” to request a read of a holding register.

  • Unsolicited mode means the device is just going to start sending data to a certain port when the data is ready—like a barcode scanner sending SKU data whenever a code is scanned.

It is usually easy to discern whether a device is solicited or unsolicited by looking at Wireshark captures or documentation. In our temperature sensor example, the device is sending unsolicited data to KEPServerEX as the temperature and humidity readings are updated every 10 seconds.

Continue through the wizard, selecting settings as desired. In Mode, ensure that the setting matches what was specified in the Communications dialog. Once you exit the wizard, you will be unable to change the mode.

Step 3

Next, create a new device under the channel. Do not change any of the default settings for this example. Once you have exited the Device Wizard, reopen the Device Properties and launch the Transaction Editor, which is a separate UI. The true value of U-CON is in the Transaction Editor, which is where you customize the driver for reading and writing data to and from the device.

For example, a snippet of code from the temperature sensor example might look like this in the Transaction Editor:

A snippet of code from the temperature sensor example would look like this in the Transaction Editor.

Note: With U-CON, transactions with the device are handled on a tag-by-tag or tag block basis. In other words, through the Transaction Editor, the user tells KEPServerEX how to handle read and write commands for a specific tag or group of tags. If an application wants to read from or write data to the device, the U-CON driver program tells KEPServerEX how to parse and handle the read data, or how to package and transmit the write data. The parsing, handling, packaging, and transmitting of data is all customizable by the user. 

And here is what the data looks like in tags in the OPC Quick Client (Kepware’s OPC DA test client):

What the data looks like in tags in the OPC Quick Client.

And now you are done! Getting data from the device into tags in KEPServerEX allows you to send data anywhere in your automation system, such as a SQL database, a webpage, or any other software or hardware package.

What’s next?

With an understanding of the data packets being sent to and received from a device, you can use U-CON to build communications in KEPServerEX. Be sure to check if we offer anything “out-of-the-box” first, but if not, you can do it with U-CON.

Update: Kepware has released a new do-it-yourself driver for Ethernet-enabled devices and systems called the Kepware Universal Device Driver. Make sure to check out the latest and greatest tool from Kepware for custom technology integration.

CTA Image

Chat with an Industrial Connectivity Expert

Ready to learn more about how Kepware can help solve your industrial connectivity challenges? Talk with one of our experts today!

Contact Us
Sam Elsner Sam Elsner leads and manages PTC’s Kepware Solutions Consultants, a global team of industrial connectivity experts who help users create connectivity solutions for industrial data acquisition, industrial automation and enterprise digital transformation. Sam has spent twenty years working in IT, OT and business development, and has deep domain expertise in Kepware products, industrial networking and systems integration. Sam holds a BA and a Minor from the University of Maine.

Up Next