-
Notifications
You must be signed in to change notification settings - Fork 989
BinaryPayloadBuilder object has no attribute to_registers() #148
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
Comments
Have the same issue, could you fix it in some way ? |
It looks like that function is broken in some way - I got around it by splitting my complex data into two registers (by default initialized as uint_16s) and configuring my client to look at the registers properly. To split a float into two uint_16s of binary data: Assuming you set your values with: Complicated, and I probably did a bad job explaining that, but I got it to work. |
any progress on this? just ran into this issue today. |
if your problem was that this function was not existing - it is because in last releases it was not there. I found it e.g. herehttps://github.com/bashwork/pymodbus/blob/master/pymodbus/payload.py :
I added it back to payload - BinaryPayloadBuilder and tested it with few values and so far - it worked... Did anyone experience problems with that function? |
This helped so much. Working late and you saved the day! Awesome!
Emerson Garland
… On Mar 29, 2017, at 9:08 AM, jjchromik ***@***.***> wrote:
if your problem was that this function was not existing - it is because in last releases it was not there. I found it e.g. herehttps://github.com/bashwork/pymodbus/blob/master/pymodbus/payload.py :
` def to_registers(self):
''' Convert the payload buffer into a register
layout that can be used as a context block.
:returns: The register layout to use as a block
'''
fstring = self._endian + 'H'
payload = self.build()
return [unpack(fstring, value)[0] for value in payload]`
I added it back to payload - BinaryPayloadBuilder and tested it with few values and so far - it worked... Did anyone experience problems with that function?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
fixed with version 1.3.0.rc1 |
2. addresses issues in pymodbus-dev#159, pymodbus-dev#156, pymodbus-dev#148, pymodbus-dev#121
I'm trying to use the binary payload builder to initialize a complex data store, but the issue I constantly am running into is that it has no to_registers attribute. I've tried working around using pack and unpack functions in python but I tend to get a bunch of errors that way.
The text was updated successfully, but these errors were encountered: