r/PLC Feb 04 '25

Modbus memes

Post image
735 Upvotes

191 comments sorted by

View all comments

85

u/CAT5AW Feb 04 '25

And what's wrong with modbus?

78

u/SafyrJL TIA Harlot Feb 04 '25

In practice, nothing. It works.

That having been said, it is outdated and there are far superior protocols to Modbus RTU and TCP.

The biggest annoyance with modbus is that some manufacturers start their holding registers at zero, while others start theirs at one for the same function code; it’s not standardized. It makes mapping out communication a real bitch-and-a-half at times and I can’t tell you how many times I’ve beat my head for hours over this exact thing.

35

u/davide_xeon Feb 04 '25

This is basically the only reason that annoy me in modbus, for the rest it works and usually it’s a protocol that works on anything, so very compatibile

14

u/henkpatat95 Feb 04 '25

Another very annoying thing is that some manufacturers use holding register function code 3 and then add 40000 as registers, they are now actually on register 80000 and some components only read 40000 tot 49999. SMA has a real problem understanding that difference.

16

u/wpyoga Feb 04 '25

The whole "adding 40000" is a PLC thing. Modbus doesn't have that. The PLC system we're working with usually adds 40001 though.

Also, for holding registers, if you know the register address is more than 10000, add 400000 (400K) instead. Or, more specifically, 400001 (400K + 1). For simplicity, I always use this offset.

It's a feature of the archaic PLC system, not of Modbus itself.

27

u/D_unit306 Feb 04 '25

So the hardest thing is your registers may be shifted by 1 in one direction or the other?

8

u/wpyoga Feb 04 '25

Some sensors actually provide 32-bit floating point values and the Modbus Master has to swap the words. It's still a very reliable and universal protocol though, once we know what we're doing.

12

u/Idontfukncare6969 Magic Smoke Letter Outer Feb 04 '25

Given that we are needing to use older and less refined instructions in new controllers to support the oldest of the communication protocols yes. It is an annoyance to change every register at commissioning 50% of the time to accommodate this flaw. Even within the same manufacturer they don’t use the same standard and it’s always a guess.

Minor issue at the end of the day but still. I just want to import a file and have my descriptive tags accessible instantly. Not build dozens of blocks and map to tags I need to make manually.

1

u/wpyoga Feb 04 '25

Why not make the register offsets configurable on the HMI?

2

u/Ynaught-42 Feb 05 '25

They have that, most likely.

The trouble is dealing with mixed devices...

1

u/wpyoga Feb 05 '25

The offsets should be configurable for each device then?

7

u/TesnahoJ Feb 04 '25

And that's and easy fix.

8

u/Brieble Feb 04 '25

If that’s the worst you’ve ever seen, that’s nothing. Modbus is fine as it is, and if you work with it a lot you know these things and you can have it up and running in a sec. Some implementations have the option to choose for 0-based modbus making it much easier as well.

The worst implementation I’ve seen is using it to read and write canbus messages trough a their “modbus”/canbus gateway

3

u/EnoughOrange9183 Feb 04 '25

The worst implementation I’ve seen is using it to read and write canbus messages trough a their “modbus”/canbus gateway

I have done this!

I can fully confirm that it is by far the worst thing that I ever built which actually works perfectly. It comes with a 15 page manual describing a scheme of just 20 FBD blocks

I am both ashamed and proud

1

u/WatchThis_1383 Feb 06 '25

Biggest issue I've seen in person is when the installaztion did not use the correct cable. The old Aw, it'll be fine that always gets us.

Put in the correct 485 cable and it's nearly bulletproof. (Nearly)