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

extend modbus with 'readfloats' and 'readlongs' #97

Open
FLMuller opened this issue Mar 16, 2023 · 0 comments
Open

extend modbus with 'readfloats' and 'readlongs' #97

FLMuller opened this issue Mar 16, 2023 · 0 comments

Comments

@FLMuller
Copy link

I am using minmodbus in lab automation, and many devices can read individual 2 register 32bit floats, (say a single 4-20 mAmp channel) but also allow reading multiple registers (so reading 4*2registers to give the current in 4 channels).

I have extended mm by adding FLOATS as a payload format and implementing a read/writefloats code in the relevant sections build request and parse results. (commented by @@@FLM). This essentially automates the combination of read/write REGISTERS and interpretation of the registers as 32bit FLOATS

This could also be extended to longs, but I have not done so, simply because I did not have the need.

I thought it might be useful to others to see, and maybe to implement in future releases of mm (which works great out of the box!)

Cheers

Frans

minimalmodbus_FLOATS.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants