Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data returned by reads #7

Closed
srini-raju opened this issue Jun 18, 2015 · 1 comment
Closed

Data returned by reads #7

srini-raju opened this issue Jun 18, 2015 · 1 comment

Comments

@srini-raju
Copy link

Hi,
I started working on modbus and saw your package. Very well written and works very well. Thanks for doing this. I don't have much experience with modbus. I have a question about the data returned by some read methods:

  • Read discrete's and Read coils are supposed to return data in hex. Is it getting converted to "int" somewhere in the code?
  • How to get the value for a single coil or register?
  • For ReadRegisters, is the data getting converted to int8 somewhere? I see some samples returning data as [205 0 0].

Thanks for your help.

@nqv
Copy link
Member

nqv commented Jun 22, 2015

Sorry for late reply.

  • The library does not convert data in response. I think the hex you see is the representation of the response data.
  • See https://github.com/goburrow/modbus/blob/master/api.go
  • Same answer to the first question.
    Do you have any examples or know where in the specs saying data is in hex?

@nqv nqv closed this as completed Jul 30, 2015
Ryanyntc2013 pushed a commit to Ryanyntc2013/modbus that referenced this issue Aug 23, 2019
Provide generic logging interface
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants