Skip to content

Commit

Permalink
print each register
Browse files Browse the repository at this point in the history
  • Loading branch information
webhat committed Oct 8, 2018
1 parent 9023517 commit 3a05598
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modbusserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ func WriteHoldingRegisters(s *mbserver.Server, frame mbserver.Framer) ([]byte, *
return []byte{}, &mbserver.IllegalDataAddress
}

for i := 0; i < len(value); i += 2 {
b := value[i : i+2]
fmt.Println("Data ", register+(i/2), b)
}

data := make([]byte, 4)
data = frame.GetData()[0:4]

Expand Down

0 comments on commit 3a05598

Please sign in to comment.