| 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
|
Initialise
|
| Starts up the UART to allow communications. Also, checks if PZEM-004T is detected. Returns 0 if detected or 255 if not detected.
|
- BYTE
|
Return
|
ReadAlarmStatus
|
ReadAlarmStatus
|
| 65535 = Overpower alarm triggered. 0 = Overpower alarm not triggered.
|
- UINT
|
Return
|
ReadAnalogInput
|
ReadAnalogInput
|
| This command requests the analogue input register values starting from the start RegAddress and going through to RegAddress plus RegCount. Returns 0 for success, 1 for CRC fail and 255 for no reply.
|
- UINT
|
SlaveID
|
| The ID of the MODBUS slave
|
- UINT
|
RegAddress
|
| Input Address: 0=10001, 1=10002, 2=10003, ...
|
- UINT
|
RegCount
|
| Number of consecutive inputs to read, starting from RegAddress
|
- BYTE
|
Return
|
ReadCurrent
|
ReadCurrent
|
| Read what the current draw is. Resolution: 0.001A Measurement accuracy: 0.5%
|
- FLOAT
|
Return
|
ReadEnergy
|
ReadEnergy
|
| Read active energy value. Resolution: 1Wh Measurement accuracy: 0.5%
|
- FLOAT
|
Return
|
ReadFrequency
|
ReadFrequency
|
| Reads the frequency of the mains
|
- FLOAT
|
Return
|
ReadPower
|
ReadPower
|
| Read active power. Starting measure power: 0.4W Resolution: 0.1W
|
- FLOAT
|
Return
|
ReadPowerAlarmThreshold
|
ReadPowerAlarmThreshold
|
| Reads the power alarm threshold in watts
|
- UINT
|
Return
|
ReadPowerFactor
|
ReadPowerFactor
|
| Read power factor Resolution: 0.01 Measurement accuracy: 1%
|
- FLOAT
|
Return
|
ReadVoltage
|
ReadVoltage
|
| Read voltage. Measuring range:80~260V Resolution: 0.1V Measurement accuracy: 0.5%
|
- FLOAT
|
Return
|
ResetEnergy
|
ResetEnergy
|
| Reset the energy value
|
- BYTE
|
Return
|
SetPowerThresholdLevel
|
SetPowerThresholdLevel
|
| Sets the power alarm threshold in watts
|
- UINT
|
PowerThresholdValue
|
| Reg addreess high of alarm threshold
|
- BYTE
|
Return
|
Property reference
|
Properties
|
|
UART Properties
|
|
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.
|
|
TX
|
| Pin to be used for Transmit data
|
|
RX
|
| Pin to be used for Receive data
|
|
Baud Options
|
| Baud rate option selector
|
|
Baud Rate
|
|
|
|
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.
|
|
Modbus Properties
|
|
Receive Buffer Size
|
| Maximum number of bytes the receive buffer can hold
|
|
Slave ID Bytes
|
| Number of bytes used when passing a slave ID, usually 1 but sometimes 2
|
|
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
|
|
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
|
|
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
|
|
Simulation Properties
|
|
Label
|
| A text label to appear on the Modbus panel object.
|
|
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.
|
|
Console Data
|
| Selects if the console data is automatically generated or not
|
|
Console Columns
|
| Number of characters that can be displayed on a single line of the console.
|
|
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.
|