Skip to content

An Arduino library for Multi-functional Energy Meter SDM120 Modbus

Notifications You must be signed in to change notification settings

ngharry/SDM120-Modbus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SDM120 Modbus Library

This is an Arduino Library for the multi-functional energy meter SDM120 Modbus.

Index

Pre-requisite

Installation

Windows

  • Open cmd, enter
cd %userprofile%\Documents\Arduino\libraries &&
git clone https://github.com/ngharry/SDM120-Modbus

to download SDM120 Modbus library.

  • Wait until the downloading process finishes.

Linux

[TODO] Add tutorial for Linux here.

How to

Convert Float to Array of Bytes (IEEE 754)

See examples/FloatToBytes.

Convert Array of Bytes to Float (IEEE 754)

See examples/BytesToFloat.

Construct Commands

See examples/ConstructCommands.

Get Raw Data from SDM120 Modbus

See examples/GetRawData.

Get all Processed Data from SDM120 Modbus

See examples/GetData.

Error Codes

HEX DEC Name Description
0x00 0 STATUS_ERROR General errors
0x01 1 STATUS_SUCCESS Function runs successfully, no errors
0x02 2 ERR_READ_RS485 No data read from RS485 communication
0xFA 250 ERR_FUNC Unrecognised function sent to SDM120

Bugs Reporting

TODO

  • Add terminology table.
  • Add more error codes (as specified in doc/SDM120 PROTOCOL.pdf).
  • Add intalling process for Linux (I love Linux).

About

An Arduino library for Multi-functional Energy Meter SDM120 Modbus

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages