I can address your observation that the decimal value 95674 (HMI) ends up wrong in the PLC DM memory.
This is a word order issue. The data transfer protocols that the HMI/PLC use break up 32-bit values into two 16-bit words. The 16-bit values are sent and then must be reassembled on the receiving end. The problem is that the PLC and the HMI do not represent 32-bit values the same way.
The 32-bit decimal value of 95674 is 0x000175BA in hex. The most significant 16-bits of the value is 0x0001 (1 decimal) and the least significant 16-bits is 0x75ba (30138). If you use the i-TRiLOGI simulator you can write 95674 to DM32[1] and then View the DM memory as 16-bit data and you will see that DM[1] holds the value 1 and DM[2] holds the value 30138. On the PLC the most significant part of a 32-bit number is stored first in PLC 16-bit memory (big endian).
In your example you started with the value of 95674 on the HMI and when it got sent to the PLC the 16-bit (word) order got messed up. The HMI stores 32-bit values with the most least significant word first and the most significant word in the next memory location (little endian).
The HMI is sending the 32-bit data in the wrong order for the PLC. If this is what you are seeing then you need to coerce the HMI into sending the 32-bit data in the correct order for the PLC to reassemble correctly.
You did not specify what protocol that you are using for the HMI to communicate with the PLC. I would suggest that you use Modbus. I can help you with the Modbus protocols.
Specify the data transfer protocol used by the HMI to communicate with the PLC. I use Modbus RTU via the RS-232 port. The critical part is "Conversion...". Click on this button near the bottom right corner. You want to set the 3x_Double and 4x_Double conversion to use the "ABCD -> CDAB" data conversion. What this does is change the order that the 16-bit data words are sent/received to ensure that the 32-bit value makes sense to both the HMI and PLC.
Now, set up address tag to access DM32[1] as a 32-bit signed integer:
- Create an address tag and give it a name that makes sense
- PLC: "MODBUS RTU"
- Address type: 3x_Double (this gets the word order correct)
- Address: 1001 (this is the correct Modbus address to access DM32[1]. Address 1003 is used for DM32[2])
- Data format: 32-bit Signed
- Conversion/Calculation (leave the Enable box unchecked)
If you are attempting to use the Host Command protocol, then you will need to call TRI for assistance.
Best regards,
Gary D*ckinson