dexdyne
Member
We've got our own s/w in a box http://www.dexdyne.com/netrix which does Modbus reads from PLCs etc..
I am aware that Modbus is seen as a set of 16-bit registers.
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, similarly some data will need 32-bit integers
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.
Our netrix modbus driver will use a block-read on any adjacent blocks of registers.
My questions are - when you do the multi-register-read:
1. Does the PLC firmware snapshot a simultaneous sample of all the Modbus registers in the requested block to a holding area , then send them to you from there?. ( as opposed to fetching them one by one as the serial data is sent )
2. If it does do such a snapshot, then is it guaranteed NEVER to occur halfway through the running 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 32-bit integer or floating point value is taking place, can I ever get half the old value, and half the new?
If I can't be sure of this, then I need to do multi-register transfers using all sorts of software semaphores and insist there are software routines built into the PLC application software to be certain of consistency. That is a horrible idea.
--------------------------
I know computer makers get paranoid about this sort of stuff, I don't know if PLC people get to same depth. I suppose they must or other people would have fallen over it before now - I just want to see it in black and white somewhere J
Is there maybe a written Modbus spec that might cover the question?
[font="]David[/font]
I am aware that Modbus is seen as a set of 16-bit registers.
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, similarly some data will need 32-bit integers
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.
Our netrix modbus driver will use a block-read on any adjacent blocks of registers.
My questions are - when you do the multi-register-read:
1. Does the PLC firmware snapshot a simultaneous sample of all the Modbus registers in the requested block to a holding area , then send them to you from there?. ( as opposed to fetching them one by one as the serial data is sent )
2. If it does do such a snapshot, then is it guaranteed NEVER to occur halfway through the running 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 32-bit integer or floating point value is taking place, can I ever get half the old value, and half the new?
If I can't be sure of this, then I need to do multi-register transfers using all sorts of software semaphores and insist there are software routines built into the PLC application software to be certain of consistency. That is a horrible idea.
--------------------------
I know computer makers get paranoid about this sort of stuff, I don't know if PLC people get to same depth. I suppose they must or other people would have fallen over it before now - I just want to see it in black and white somewhere J
Is there maybe a written Modbus spec that might cover the question?
[font="]David[/font]