×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

MUlti-register read on modbus

MUlti-register read on modbus

MUlti-register read on modbus

(OP)
I am aware that Modbus is seen as a set of 16-bit registers.

I am aware that some of the numbers I'll want to read across a Modbus will need >1 adjacent 16-bit registers - floating point for instance needs 2 or 4.

Similarly some data will neeed 32-bit integers, which could suffer in the same way.

It would obviously be a disaster if I read the top 16 bits of an old value, and the bottom 16 bits of a new one. Integer counters could be wrong by 64K, floating point values by almost any amount.

If we use the modbus "read-a block-of-registers-at-once" command, can we be totally confident that the PLC will snapshot all the registers in the block in between any 32-bit-integer or floating-point write operation by the PLC program, and that we CANNOT be given an inconsistent half-and-half value?

Or do I need to do multi-register transfers using all sorts of software semaphores and software routines built into the PLC software to be certain of consistency?

David

RE: MUlti-register read on modbus

This depends on how you are reading the registers.  If you are  manually writing Modbus commands you will simply specify the start address and number of registers and you will get a snapshot of the congruent registers.  You'll then have to parse them yourself.  If you are using an I/O server most will allow you to specify the type of data using a modifier on the address.  For example, if I ask for "R30008" I'll get a 16 bit integer.  If I ask for "R30008:L" I'll get a 32 bit long integer corresponding to R30008 and R30009.  If I ask for "R30008:R" I'll get a 32 bit real of the same two register.  The modifier is specific to the I/O server so you have to review the documentation to determine what to use.

RE: MUlti-register read on modbus

(OP)
Thanks mls1,

We've got our own s/w in a box

see http://www.dexdyne.com/netrix

which does the Modbus reads. It will use a block-read on any adjacent blocks of registers, so we're half way there.

The Modbus driver at our end is home-brewed, and I'm going to have to get the programmer guy to build me a more comprehensive set of modifiers - at present we only handle 16-bit unsigned and 32-bit fpt properly.

--------------------------

My real question was - when you do the multi-register-read:

1. does the PLC firmware snapshot a sample of all the registers in a block to a holding area , then send them to you from there?.

2. If there is such a snapshot, then is it guaranteed not to occur halfway through the PLC application updating a 32-bit value... in other words if I ask for the Modbus read while a write to Modbus-visible-memory of a fpt value is taking place, can I ever get half the old value, and half the new?

I know computer makers get paranoid about this sort of stuff, I don't know if PLC people get to same depth.

David

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources