AdvancedHMI Software
General Category => Support Questions => Topic started by: andrew_pj on February 02, 2015, 10:37:22 PM
-
Dear all,
Does anyone know how to handle DOUBLE WORD (%MD)?
I am using version AHMI 3.97e and WAGO 750-881.
I am able to communicate + read & write data between WAGO and AHMI.
However, when using %MD, unexpected result occurs.
It will show very large data, described in the following scenario:
I modify value of %MD1200 = 1
Then, in AHMI, the value is showing 16256 at address 414690.
I expect to get 1 in AHMI, which is the case when I modify %MW1000 = 1
In AHMI, the value is showing 1 at address 413289.
Please refer to attachment for more details.
Thank you.
Best regards,
Andrew
-
When using a double word, you have to put an L in front of the address. Try L414690
-
When using a double word, you have to put an L in front of the address. Try L414690
Try that and doesn't work. It's still showing 16256.
-
This is just a guess, but in CodeSys, the addresses are designated in byte offset, but Modbus uses word offset. So if MW1000=413289, then would MD1200 be this?
413289 + 100 (words) = L413389
-
Hi Archie,
I think it is uncommon to use %MD in modbus.
So, it should be converted to %MW internally in PLC before going to modbus.
Sorry for the mess.
Best regards,
Andrew
-
Sorry for necromancy but I thought I'd give a proper answer to the question
Since I implemented Modbus TCP in our library recently I can help
%MDx is located at 0x3000+x*2 and 0x3000+x*2+1
0x3000 (or 12288 in decimal) is the offset for "M" area registers. That means MW100 is on address 12388. MD100 is located on 12488 and 12489.
Hope that helps. Also make sure to be consistent with endianess so you don't swap the two words around.
/Surukai