Skip to content
/ dlt645-go Public

使用 Golang 实现的多功能电能表通信协议

License

Notifications You must be signed in to change notification settings

xgbt/dlt645-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dlt645-go

使用go实现的多功能电能表通信协议

支持的指令

  • Read Data
  • Write Data
  • Read Communication Address
  • Write Communication Address
  • Broadcast Timing
  • Freeze Command
  • Change Communication Rate
  • Change Password
  • Clear Maximum Demand
  • Clear Ammeter
  • Clear Event

版本支持

  • DL/T 645 2007

用法

Basic usage:

// default configuration is 19200, 8, 1, even
handler := dlt.NewClient2007Handler(rtuDevice)
err := handler.Connect()
defer handler.Close()
client := dlt.NewClient(handler)
results, err := client.ReadData(00000000, 0, 0, 0, 0, 0, 0)

Advanced usage:

handler := dlt.NewClient2007Handler(rtuDevice)
handler.BaudRate = 4800
handler.DataBits = 8
handler.Parity = "N"
handler.StopBits = 1
handler.RS485.Enabled = true
handler.SlaveAddr = 304257140001
err := handler.Connect()
defer handler.Close()

client := dlt.NewClient(handler)
results, err := client.ReadData(00000000, 0, 0, 0, 0, 0, 0)

References

About

使用 Golang 实现的多功能电能表通信协议

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages