☰ Contents
Unit for reading data from the energy monitor PZEM-004T


        



The block is used to read data from the module

Attention!
The unit works with modules since the 3rd version..
With versions 1 and 2 the unit does not work


The block is configured using the block editor.




In the module settings, select the UART to which the module is connected, or the module loop.

When the "kilowatt - hour counter reset Input" checkbox is activated, the unit creates an "R" input. On the leading edge of the pulse at this input, the kilowatt-hour counter in the module is reset.

When you activate the "voltage Output" checkbox, the unit creates an output "Voltage" on which the current voltage value measured by the module in volts will be displayed.

When you activate the "current Output" checkbox, the unit creates an output "Current" on which the current value of the current measured by the module in amperes will be displayed..

When you activate the "power Output" checkbox, the unit creates an output "Power" on which the current power value measured by the module in kilowatts will be displayed.

When you activate the checkbox "Output kilowatt-hours" the unit creates an output "Energy" which will be the current value of the counter kilowatt-hours measured by the module.

When you activate the "frequency Output" checkbox, the block creates an output "Frequency" on which the current value of the network frequency measured by the module in Hertz will be displayed.

When you activate the checkbox "Output power factor" the unit creates an output "PF" which will be the current value of the power factor measured by the module.


The default data type on module inputs is Float.

To save controller memory, you can activate the checkbox "Use integer values on outputs". In this case, the data type on the outputs will change to Integer and at the output "Energy" the data type will become Unsigned Long. The values on the outputs will be as follows:


Voltage Voltage in volts *10
Current Current in milliamps
Power Power in Watt *10
Energy Watt-hour counter
Frequency Frequency in Hertz*10
PF Power factor*100


In the "polling Period" field, you specify how often the module will be polled.

According to the module manufacturer, it is not recommended to poll the module more than 2 times per second. I successfully checked the polling frequency of 200 milliseconds, But it is possible on other instances of modules with such frequency there will be errors.

When connecting several modules with a loop to one UART (using UART <-> RS485 converters), the "Use address" checkbox must be activated.


In the "Address" field that appears, enter the address of the module with which this unit will work.

Several energy monitor data reading units can be linked to one UART.