Component: Energy Monitor (PZEM-004T) (Electrical)

From Flowcode Help
Revision as of 13:00, 18 July 2023 by Wiki bot (talk | contribs)
Jump to navigationJump to search
Author Matrix Ltd.
Version 1.0
Category Electrical


Energy Monitor (PZEM-004T) component

The PZEM-004T module is used for measuring AC voltage, current, active power, frequency, power factor & overcurrent. Resetable active energ and the overpower level can be set and monitored.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_Energy_Monitor_PZEM-004T.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_Energy_Monitor_PZEM-004T.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples


Macro reference

Initialise

Fc9-comp-macro.png Initialise
Starts up the UART to allow communications. Also, checks if PZEM-004T is detected. Returns 0 if detected or 255 if not detected.  
Fc9-u8-icon.png - BYTE Return


ReadAlarmStatus

Fc9-comp-macro.png ReadAlarmStatus
65535 = Overpower alarm triggered. 0 = Overpower alarm not triggered. 
Fc9-u16-icon.png - UINT Return


ReadCurrent

Fc9-comp-macro.png ReadCurrent
Read what the current draw is. Resolution: 0.001A Measurement accuracy: 0.5% 
Fc9-f32-icon.png - FLOAT Return


ReadEnergy

Fc9-comp-macro.png ReadEnergy
Read active energy value. Resolution: 1Wh Measurement accuracy: 0.5% 
Fc9-f32-icon.png - FLOAT Return


ReadFrequency

Fc9-comp-macro.png ReadFrequency
Reads the frequency of the mains 
Fc9-f32-icon.png - FLOAT Return


ReadPower

Fc9-comp-macro.png ReadPower
Read active power. Starting measure power: 0.4W Resolution: 0.1W 
Fc9-f32-icon.png - FLOAT Return


ReadPowerAlarmThreshold

Fc9-comp-macro.png ReadPowerAlarmThreshold
Reads the power alarm threshold in watts 
Fc9-u16-icon.png - UINT Return


ReadPowerFactor

Fc9-comp-macro.png ReadPowerFactor
Read power factor Resolution: 0.01 Measurement accuracy: 1% 
Fc9-f32-icon.png - FLOAT Return


ReadVoltage

Fc9-comp-macro.png ReadVoltage
Read voltage. Measuring range:80~260V Resolution: 0.1V Measurement accuracy: 0.5% 
Fc9-f32-icon.png - FLOAT Return


ResetEnergy

Fc9-comp-macro.png ResetEnergy
Reset the energy value 
Fc9-u8-icon.png - BYTE Return


SetPowerThresholdLevel

Fc9-comp-macro.png SetPowerThresholdLevel
Sets the power alarm threshold in watts 
Fc9-u16-icon.png - UINT PowerThresholdValue
Reg addreess high of alarm threshold 
Fc9-u8-icon.png - BYTE Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png UART Properties
Fc9-type-16-icon.png Channel
UART Channel selector Software channels are bit banged using generic I/O pins but are not as reliable as hardware channels. Hardware channels use the selected peripheral on-board the target microcontroller. 
Fc9-type-5-icon.png TX
Pin to be used for Transmit data 
Fc9-type-5-icon.png RX
Pin to be used for Receive data 
Fc9-type-16-icon.png Baud Options
Baud rate option selector 
Fc9-type-14-icon.png Baud Rate
 
Fc9-type-16-icon.png Bus
Specifies the bus mode being used, RS232 allows you to connect a single master node to a single slave node. RS485 allows you to connect a single master node to multiple slave nodes. 
Fc9-conn-icon.png Modbus Properties
Fc9-type-21-icon.png Receive Buffer Size
Maximum number of bytes the receive buffer can hold 
Fc9-type-21-icon.png Slave ID Bytes
Number of bytes used when passing a slave ID, usually 1 but sometimes 2 
Fc9-type-21-icon.png Silent Interval
Configures how much time to wait after each master modbus command before another command can be sent. A silent interval of 60ms minimum is required in order to guarentee successful reception of the next transmission. 0=No Delay 60 = 60mS - Default Range : 0 - 65535 
Fc9-type-21-icon.png UART Receive Timeout
Amount of time to wait before timing out when listening for a slave's response. Range: 0 - 255. 0 = Don't Wait 1 - 254 = X ms 255 = Wait Forever 
Fc9-type-21-icon.png Receive Timeout Count
Number of timeouts in a row to wait for until we decide the slave is not responding or finished responding to a message. Range: 0 - 255 0 = First Timeout Only 1 = First Timeout + 1 2 = First Timeout + 2 
Fc9-conn-icon.png Simulation Properties
Fc9-type-10-icon.png Label
A text label to appear on the Modbus panel object. 
Fc9-type-7-icon.png Scope Traces
Selects if the scope traces are automatically added to the data recorder window or not. Simulation - draws an approximation of the UART data onto the scope trace. ICT - sets up the scope trace for incoming data and adds UART packet decoding at the correct BAUD. 
Fc9-type-7-icon.png Console Data
Selects if the console data is automatically generated or not 
Fc9-type-21-icon.png Console Columns
Number of characters that can be displayed on a single line of the console. 
Fc9-type-16-icon.png Data Source
Simulation data source used to allow the component to connect to various remote devices Nothing - Simulation data is ignored COM port - Routes the communication data to and from a physical or virtual COM port API - Routes the communication data via a data API component on the Panel.