Share this

How to convert PLC digital signals to analog signals?

2026-04-06 06:20:08 · · #1

To convert between digital and analog signals in a PLC , it's essential to understand the meaning of three layers: the device signal layer, the PLC software application layer, and the PLC internal processing layer.

Device layer: Switch signals are on/off signals, and analog signals are linear voltage or linear current signals.

PLC software application layer: Digital quantities are 0 and 1 switch nodes stored in binary form in the PLC internal registers, while analog quantities are engineering quantities (such as 255, 32767, 65535) stored in hexadecimal form in the PLC user registers.

Internal processing layer: All operations are performed using binary operations, retrieved from registers.

In the PLC software application layer, the conversion between digital and analog signals can be achieved simply by using relevant instructions (such as Mitsubishi K1M0) to convert the binary digital signal into hexadecimal and store it in the PLC user register.

The conversion between digital and analog signals generally involves holding and digitizing. For example, digital signals can be subject to interference. To eliminate this interference, software can be used, such as reading the switch status every few milliseconds. Only if the status is read twice is the switch considered off; otherwise, it is considered interference. Of course, interference can also be eliminated using hardware, such as Schmitt triggers.

For analog signals, quantization is also performed. For example, with the 0809 AD converter, the conversion method is difficult to explain here; you can consult the chip datasheet. The 0809 chip has control pins for conversion, enable pins, and conversion address, etc. It can be controlled by an 8051 microcontroller. Of course, there are also advanced microcontrollers, such as the MSP430 and AVR, and even better conversion chips, such as the STM32 series of DSP chips, which are dedicated digital-to-analog converters. The conversion principle is based on the precision of the conversion chip, dividing the conversion quantity. For example, if the conversion chip has 8 bits, and assuming the analog quantity to be converted is 5 volts, then 5 volts can be divided into 256 equal parts (because an 8-bit chip can only handle 2 to the power of 8), thus obtaining its digital value. The reverse is also true.

Common analog signals include voltage and current signals. Input signals are used to control equipment, such as speed control in frequency converters and proportional valves for air pressure. Output signals are commonly found in various sensors and other output devices. The conversion relationship between them needs to be determined by referring to the AD/DA module and the device's range.

DA module

The relationship between its digital value and the analog signal voltage is shown in the following figure:

The digital value of the 4000 range on the module side corresponds to a 10V voltage signal, and conversion is performed according to this relationship. On the device side, the relationship between the inverter frequency and the analog value is: 50.00Hz corresponds to a 10V voltage signal input. Therefore, in PLC programming, the frequency-to-digital conversion relationship is 1 digital value = 1.25Hz or 1Hz = 0.8 digital values. For example, if we want to control the inverter to operate at 30.00Hz, we need to write a digital value of 2400 into the DA module.

AD module

The relationship between its analog voltage and digital voltage is shown in the following figure:

At the module end, a 10V analog signal corresponds to a 4000-digit digital signal, and the conversion is performed according to this relationship. At the device end, for example, the relationship between the distance of a position sensor and the analog voltage signal is: a 200mm range corresponds to a 10V analog output. In the PLC program, to obtain the accurate position, the relationship between position and digital signal is 1mm = 20 digital signals or 1 digital signal = 0.05mm. If we detect a 2000-digit digital signal, after conversion, we know the position is 100mm.

As for the conversion relationship between digital and analog signals, it should be said that analog signals control digital signals. For example, if the motor speed exceeds a certain value, the motor should be turned off; if the temperature is above a certain degree, heating should be stopped; or if the temperature is below a certain degree, heating should continue. At this time, we monitor these data through the AD module, compare them in the PLC, and output the corresponding switching action based on the comparison result.

Read next

CATDOLL Tami Hard Silicone Head

The head made from hard silicone does not have a usable oral cavity. You can choose the skin tone, eye color, and wig, ...

Articles 2026-02-22