PLC Programming Handbooks
How to Configure 4-20 mA Analog Inputs on a PLC
by Johan Esvelt from DIVIZE
A PLC (Programmable Logic Controller) is used for the control of industrial machines and process installations. The PLC was designed specially for this purpose and offers the possibility of a flexible configuration by means of hardware and software to be adapted to the machine or process which needs to be controlled. Analog signals such as pressure and temperature from the process are evaluated by the PLC and based on these signals the process is controlled by the PLC. Analog signals need to be connected to the PLC and configured. Because of the modular design and configuration of the PLC many things can go wrong. This article gives some guidelines.
1. Determine how to connect the sensor to the PLC.
Most analog inputs on PLC systems support voltage, current and resistance on their analog inputs. In order to accomplish the connection the first thing is to determine how the 4-20 mA sensors will be connected to the PLC. On some PLCs locating the correct terminal is enough, sometimes jumpers need to be configured, and on some PLCs the input is configured by software. On some PLCs a resistor must be connected in order to transform a voltage input to a 4-20 mA current input. Check the documentation of the PLC before the sensor is connected to the analog input on the PLC.
2. Determine how the analog value is represented in the PLC.
Inside the PLC the A/D converter transforms the analog signal to a digital value. The digital value represents the analog signal. In case of a 10 bit A/D converter the digital value lies between 0 and 1024. Some A/D converters can generate negative values. The minimum signal is 4 mA with a 4-20 mA signal. When the signal is lower then 4 mA the digital value is negative, or is 4 mA a positive value? Read the PLC manual in order to determine how the A/D converter handles the negative value. Does the PLC make it zero or does it need a correction in software. Also check on which address the value is available to the PLC program. In case you are not sure about the configuration it may be wise to build a test setup to check it. With a current loop tester, the analog signal on the PLC can be simulated which makes it is easy to validate the configuration of the PLC.
3. Make sure the value is scaled properly.
The digital value in the PLC needs to be scaled to a meaningful value and readable by humans. A pressure of 0-16 bar is represented inside the PLC by a value between 0 and 1024, while on the display a value between 0 en 16 bar is needed. This needs some calculation. Some PLCs come with standard software functions for this purpose. When these are not available, the user has to write these software routines. These software routines can be tested by means of the test set-up from step 2.
4. Check your alarms!
Usually analog inputs are guarded by alarms. Both process alarms as well as hardware alarms. What happens when a wire breaks on a 4-20mA input? Is this recognized as a wire-break alarm or as a process alarm, low temperature, low pressure? When is the wire-break alarm activated? Is the alarm activated immediately or after a pre-defined time minimizing false alarms? Does the sensor comply with the Namur NE43 recommendation? In this caser a sensor fault can be represented by a current higher then 21 mA. Is your software capable to handle all these situations? In case the 4-20 mA input is compatible to the Namur NE43 recommendation the alarms can be tested with a current loop tester with extended current range.
5. Test your configuration before commissioning.
When things go wrong it can take a lot of time and money to resolve configuration issues with 4-20 mA analog inputs. Especially when these issues appear during commissioning on site. In order to test the analog inputs DIVIZE has a complete range of current loop test units. Every step of a 4-20 mA configuration can be tested and validated with the help of a DIVIZE 4-20 mA simulator. Problems with the analog input configuration and signal can be identified and resolved in an early stage. Unnecessary delays in commissioning can be eliminated.