plc4x-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christofer Dutz <christofer.d...@c-ware.de>
Subject [MODBUS][DISCUSS] Improving handling of datatypes ...
Date Wed, 02 Sep 2020 13:21:26 GMT
Hi all,

today I was at a customer’s site and used the Modbus driver to get data. This generally
worked fine.
The thing however I found a little complicated, was that the PLC seemed to offer all values
as 32Bit Floating point values.
So in order to correctly read them, I had to read an array of two consecutive shorts and then
manually convert them into a float.

I bet we can do this better.

So I thought … how about we use the same https://en.wikipedia.org/wiki/IEC_61131-3 datatypes
we are already using in other drivers and for example if you write:

holding-register:1:REAL

it would automatically use modbus to read an array of two shorts and to internally convert
these to one REAL/float.

What do you think? I think we could probably do this in most drivers.

Chris


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message