Modbus: Discrete Signals as Float

AaronJVR

Member
Join Date
Jan 2024
Location
Philippines
Posts
1
Hi Everyone,

We are EDAC Electronics Australia and we provide wireless automation solutions and I/O distribution products, with expertise in alarm monitoring solutions.

Currently we are developing a new alarm monitoring solution called Guardian detect that has 8 DI, 2 AI, and 2 RO IOs, plus modbus RTU and TCP capability.

We would like to get the community's thoughts on "accessing discrete (on/off) modbus signals as floating point data type". E.g. Pump Alarm = ON: 1.0, Pump Alarm = OFF: 0.0 (as 32-bit float registers). I also attached my own entry on this topic (see attachment) but we would like to get your opinion as well.

We highly appreciate your feedback, and feel free to ask questions on this thread.

-Aaron
Sales & Application Engineer
 
Why not have the digitals as a UINT. We can then access the bits from the PLC program easier. Only use FLOAT for analogue values.
 
Why.?
It just goes against convention IMHO, especially considering floating point support is less supported than standard 16-bit register reads.
As Bob said, it would make much for sense to use a UINT, although it does not sound like you are packing the bits into a word (which would be so much more common …)
 
Apart from what has already been said,

That PDF document is very confusing, IEC-61131-3 has nothing to do with Modbus.

Furthermore, Modbus does not define how a floating point data type is sent, it only defines the sending of bits and 16-bit words, nor does it even define whether it is signed or unsigned.

But in the real world, floating point data types are sent, but they do not all use the same endianness.

My recommendation is that you change teacher or school.
 
Why not have the digitals as a UINT. We can then access the bits from the PLC program easier. Only use FLOAT for analogue values.

Agree with this.

But in the real world, floating point data types are sent, but they do not all use the same endianness.

Because of this.

Using a float for analogue makes sense for the range and resolution, but here you're not gaining anything while adding a risk.
 
Bad Idea to use floating point for a discrete value when an unsigned integer is far more intuitive and does not carry the baggage of endianess, word and byte order, that is inherent in IEEE 754 floating point.
 
The Modbus data model already supports discrete signals, so why not use Discrete Inputs or Coils for your discrete signals?


Although, because registers are far more commonly supported, it may also be a good idea to map the discrete signals to registers as well.



Therefore, for best compatibility with master devices, I recommend considering mapping your discrete signals to both Discrete Inputs (or Coils if read/write) and Input (or Holding if read/write) Registers (bit-packing each registers with up to 16 discrete signals).
 
32-bit anything in Modbus always involves guesswork regarding the word order. Just asking the question implies you're cutting corners, so why even have floating point --nothing in your device's capabilities implies needing it, since most analog inputs are 12-16 bits of accuracy.

Just use 16-bit integers, that's all anyone using Modbus expects anyway. If you want to provide fractional representation, include a multiplier in the documentation; it's very common especially for temperature.
 

Similar Topics

Hello, I am attempting to add some IO Discrete tags to a AVEVA InTouch project (version 2020). These tags use the MBTCP driver and attempt to map...
Replies
1
Views
1,188
hello, i am confused about modbus discrete input. i found an example online, HMI is Client, PLC is server. To read the "motor servo-on status"...
Replies
1
Views
1,618
Hi Experts, I am working on ,Modbus CPU is Ic200CPU001 GE. i followed manual gfk2220a.pdf in which program is working great i can read holding...
Replies
1
Views
2,492
Hi Everyone, i was hoping for a little help with this module. i have data that needs to be read from a different plc through the Modbus plus...
Replies
11
Views
227
Back
Top Bottom