800xA 5.1 FP4 RevE - DInt value is transfered to Modbus (CI 867) in a wrong way
Using Real_To_DInt I convert real value to dint and transfer it with CI 867 module to Modbus TCP for external system.
In program all expected numbers are shown - see screenshots 1 & 3.
I use "MD" address to get 2 words for number.
But if check screenshots 2 & 4 you can see that in Modbus one of the values is wrong.
When value is more then 65536 it is transfered to Modbus holding registers by module instead of using second word (register) for high bits.
All my experiments showed that secord register is always 0 & never used.
I've tried different Modbus client programs, but result is the same everywhere.
Voted best answer
Rob is correct here i believe, only 16 Bits will be transferred via Modbus so you need to convert it to 2 "int" Variables.
You can have structured Variables defined in which case each Component will take one Address, but this does not apply for a Variable of Type dint for which only one Register of 16 Bits will be used - there is no such example in the Manual for Access Variables but check for example MBTCPWrite function block:
Limitation for DINT data type
The valid range for DINT datatype used for ModBus TCP communication is between -32768 and +32767.
For CI867 configured as master unit in ModBus TCP communication, writing DINT values (through MBTCPWrite) below -32768 and above 32767 throws the error -7005.
For CI867 configured as slave unit in ModBus TCP communication, if the master CI867 is writing negative values (through MBTCPWrite), then on the slave side these are converted to the equivalent unsigned integer values, and the range of values is between 0 and 65535 (for example, writing -32767 through MBTCPWrite in master shows as 32769 in slave CI867, and writing -1 through MBTCPWrite in master shows as 65535 in slave CI867).
Is it these programs are separate and are running in diff apps with diff CI867 as slave?
You can't perform the diff program values can refer to the same address to read in modscan..always give the diff address for the diff program/variable values
If you are trying to combine the LSB and MSB then better to use real_dwords function
By looking at the programs snap:
Snap3:40000 value which u are sending to modscan master with address
%MD10#142=40143 and it looks its running with high priority task so this value is displaying in the modscan.