Jump to content

Making Modbus easier


Joe Tauser

Recommended Posts

  • MVP 2023

This is not an easy request, but the problem has come up with several of my customers multiple times. The typical PLC user is not experienced with communication.

We have Modbus function blocks for every type of communication, and they individually work great. The problem I have run into with users is you have to write a quasi-driver to use them. Specifically, you have to write logic to handle the interference between reads and writes, and if you're harvesting data from multiple non-contiguous registers or data types from a single slave the timing logic can get really messy. It gets even more complicated with multiple slaves.

I propose a data-type table containing slave ID, register address (the real Modbus one, not the -1 offset we currently use), table length, integer or long data type, Unitronics target address, a polling rate for reads, and an MB to trigger writes. Multiple writes could be triggered by the same MB. The handshaking between all these activities would be transparent to the user.

This is how every HMI screen I've ever worked with does it. The user never sees the gymnastics behind the scenes to coordinate the multiple read and write requests.

Joe T.

Link to comment
Share on other sites

Hi Joe,

I hope our R&D will read the topic and will take notes. Meantime - small tip:

You can use module "Struct". This module will arrange diferent data types, from different places to one MI vector. I know it's not exactly what you aske about, but in case you want to read/write diferent operands, from different areas, this can simplify sensitivelly the program and, for me even more important - will spead very much the communication. As Modbus is "handshake protocol and each command request confirmation, usually reading 10 registers in one command is much faster than rea"d two registers one by one.

Link to comment
Share on other sites

  • MVP 2023

Yes, R&D is taking notes.:rolleyes:

It is a good idea.

However--it is August. I placed it as a time-based request, so it will pop up at the beginning of September, when all of the relevant people will be back and normal work resumes...

Cara-

Don't tell me you guys follow the European "we all take a month off in summer" policy. :o (BTW - to all of you who do this - I am extremely jealous)

And that "normal work" thing - can I buy some of that? ;)

Joe T.

Link to comment
Share on other sites

  • External Moderators

On a related note, CanOpen could sure benefit from some improved automation. Damian and I were both harping about having to essentially write a driver from component parts to assemble a motion control method.

If only there were some standard that emphasized motion control over CanOpen, and had pre-configured PDOs for communicating with drives directly... :huh:

Oh, wait - there is! DSP402! ;)

That would surely help us CanOpeners over here :blink:

Thanks!

TM

Link to comment
Share on other sites

  • MVP 2023

On a related note, CanOpen could sure benefit from some improved automation. Damian and I were both harping about having to essentially write a driver from component parts to assemble a motion control method.

If only there were some standard that emphasized motion control over CanOpen, and had pre-configured PDOs for communicating with drives directly... :huh:

Oh, wait - there is! DSP402! ;)

That would surely help us CanOpeners over here :blink:

Thanks!

TM

Tim, there already is a standard tool for CanOpeners-

can opener.jpg

Joe T.

Link to comment
Share on other sites

  • 2 weeks later...
  • External Moderators

I wondered about that when I saw the Modbus Protocol first time. Maybe because I was using a lot of HMIs with that way of work. It would be a wonderful tool for newbies in communications.

By the way, I've spent my three weeks of summer holidays and I can say it's not easy to work at 40ºC in the streets.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.