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
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
RE: MUlti-register read on modbus
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