Fitting Machine Data in Your Network Using Gateways and Other Tools
Sometimes getting an industrial machine connected and talking to your SCADA system is as easy as setting the IP address, subnet mask and gateway to talk on your plant network. But other times getting devices connected to your network can feel like trying to fit a square peg in a round hole. You have a device that has a serial interface but no Ethernet connection; your machine is “network capable” and has Ethernet but doesn’t support a protocol recognized by your SCADA system; you have a machine that is critical to your operations and line performance but the controller is proprietary and/or doesn’t have any options for networking or intelligent output. Do any of these scenarios sound familiar? If you have been working as a controls engineer or system integrator for any length of time, I suspect at least one of these scenarios hits home. But before you throw in the towel and give up on getting meaningful data consider some of these options.
Serial to TCP/IP Ethernet Adapters
Several companies including Advantech, and Automation Direct offer a simple device that will translate a RS232, RS422 or RS485 serial data stream to an Ethernet TCP/IP data stream. These converters range anywhere from just under a hundred dollars to several hundred dollars. Some of the higher priced converters will connect multiple serial ports to a single Ethernet connection. For systems like checkweighers, scales, flow meters or PH meters which are designed to print data to a serial printer, or produce a stream of process data, this can be a useful method to capture that data stream and populate data table in your SCADA system. Getting these adapters configured and connected is generally fairly easy. But once you have the data you will need to have a method to strip and parse the data into useful content for the database. Fortunately, most of the popular SCADA systems like Ignition allow you to write macros or scripts to condition your data before it is loaded into the data tables.
Printer data will sometimes have extraneous information in the form of page headers, column headers, column separators and other characters that have no value in the data base. Once you have stripped out those parts of the data stream you will need to identify markers or a sequence of characters that precedes each data set and each data field so the data is loaded into the appropriate record and field. For example, on a checkweigher you may have a time/date stamp followed by a value that represents the product weight followed by a good/reject flag. For each new entry you will probably want to have the time/date in one field, the product weight in the second and the reject flag in the third.
There are a couple things to keep in mind when using a serial to TCP/IP connection. First, most serial printer data streams have no way to establish a handshake to the receiving system or buffer data. That means the device sending the serial data stream will not know or care if the connection to the network is lost. If the connection is lost, so is the data stream. Second, you may need to initiate communication to the adapter or send it startup sequence when you first open the port to the adapter.
Protocol Gateways
When you have a device that has a built in network connection but the protocol is not supported by your network infrastructure or your SCADA system, protocol gateways can be a very useful tool to bridge the gap. One commonly used gateway is the Modbus RTU to Modbus TCP converter. This type of converter can take communication from multiple Modbus RTU nodes and convert the data to Modbus TCP for transport over traditional Ethernet based networks. Protocol gateways come in wide range of capabilities and prices. You can find gateways from Advantech, and Automation Direct that are in the $100 range. On the other end of the spectrum there are products like Red Lion’s Data Station Plus that touts the ability to talk to and convert over 300 different protocols. This makes it easier to get devices connected and talking either to each other or to your SCADA system. However, if you want to extract any meaningful data from your machine or device you will need to have a list of registers that can be read from the device and what each of those registers represents. Some equipment manufactures will supply a list of registers or the machine source code or program so you can see what data is available.
Data Concentrators
So what do you do when you have a machine or system that doesn’t have a PLC, industrial controller or access to any meaningful data in the form of serial or network communications? One possible solution is the use of a data concentrator or data logging controller. Data concentrators are typically small PLCs that act as a gateway or bridge for one or more systems. The concentrator communicates with the various systems, stores data in registers in the concentrator and then has a single connection to the plant network where it can connect to your SCADA system. In the case where a machine has no viable method of communication you can use a PLC as a data concentrator with discrete or analog input cards to capture the state of critical process parameters and then pass that information on to your SCADA system. This can take some work but with a good set of electrical schematics for your equipment you can often find the signals that indicate when the process is running and when it has alarmed and which will allow you to derive basic uptime information. If you have a signal that repeats with each cycle, you can use this to determine cycle rates. There are some precautions you have to take when connecting an external PLC to an existing machine. Most importantly, never modify or piggy back off signals and circuits related to the machine safety circuit. Even the most minor changes or additions in a safety circuit can compromise the safety integrity level of a piece of equipment. No amount of data is worth compromising safety.
Discrete or Digital Connections
When connecting a PLC to signals on an existing system there are several other considerations that need to be factored in your design. First, if your new PLC is going to be powered separately from the existing system, you will want to keep the new PLC electrically isolated. You do not want any voltage that is sourced from the existing machine to be tied to voltage being sourced by your new PLC. This includes, AC power, AC neutrals, 24VDC commons or even 24VDC neutrals. Even connecting the neutrals can create ground loops which can create problems in your machine control system. I recommend using an isolator relays, either mechanical or optical (preferred) for each signals you want to monitor.
When choosing an isolator relay it is critical that you use a relay that matches that has a coil voltage that matches the signal voltage and has a coil current consumption that is compatible with the source power supply and device being monitored. It is also important that the isolator relay has a switching frequency that is fast enough to respond to the state change rate of the device or signal. In addition you will need to make sure the PLC and PLC input on the data concentrator are capable of capturing the signal change of state.
When it comes to digital DC signals you will want to pay attention to how current flow is controlled through the load or input on the machine. There are two basic types of DC Input/Output circuits: sinking and sourcing.
The figure here depicts a sinking input.
With a sinking input, the coil of the isolator relay should be in parallel with the PLC input with the A1(+) connection on the signal input and the A2 (-) on the DC common/neutral.
On the other hand, if you have a sourcing input, your circuit will look like this it is a sourcing input.
With a sourcing input the coil of the isolator relay will still be in parallel with the input but with the A1(+) terminal in the supply voltage and the A2(-) connected to the signal input.
Analog Connections
Sometimes a machine has important process or data such as temperature, pressure, level, flow rate, etc that would be useful to capture and log in your SCADA system. Mirroring these signal to your data concentrator PLC can me more problematic and in some cases not possible without distributing or corrupting the source signal. In the case of thermocouple or RTD temperature sensors, I have yet to find a practical method of splitting off an isolated signal to feed the original controller as well as the data PLC. In this case, it seems to be easier to add a second temperature sensor to monitor the same point.
If your analog device has 0 to 10VDC signal you are in luck. It is generally pretty easy to connect an analog input card in parallel without impacting the original signal. Just make sure your signal cable is properly shielded and you keep the length of the cable short enough to avoid adding too much resistance to the circuit.
If you have an analog device with a 4 to 20ma (or 0 to 20ma) signal you may have a couple options. Some devices have current drivers that support more than one input. In this case you can simply place the data PLC analog input in series with the controller input. However, this will introduce the potential to lose the input signal to the controller if there is a loss of connection at your data PLC or between the data PLC and the controller. To minimize potential lost connection one option is to add 500 ohm resistor in the current loop in the machine control cabinet. This will yield 2 to 10VDC across the resistor which you can then connect to a 0 – 10VDC analog input on you data PLC. If you want to completely isolate the two controller you can use a signal a 4 to 20ma signal splitter which will take the original analog signal and replicate that signal on two isolated outputs to drive the original controller and the analog input on the data PLC.
Getting data from your process and equipment can be easy and sometimes it can be challenging. In almost all cases there are options for getting data and if your operations and maintenance teams can benefit from that data, the effort is almost always worth the reward. As you approach each new connectivity issue you have the opportunity to not only gain insight into line performance and opportunities but you build on your library of knowledge which will make your next challenge less daunting. Keep moving forward and stay connected!
All of those things in the article sound very much like what we implemented or wanted to at CCI. Nice article Rick. Hope all is going well.
Nice write up, Rick!
Great article Rick!!