Skip to content

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

@FLMuller

Description

@FLMuller

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions