Not very often I ask for help, but this one has got me stumped.
There are two ways to indirectly address memory areas in Mitsubishi PLC's.
Using the index registers Z0-Z15, these act as pointers to an offset in the Z register so for example if 10 is put in the Z0 register then you do a move
[MOV 1234 D0Z0] it will move the value 1234 into D0+10 (D10), however, the other way is to use the ADRSET function, this moves the actual address of the variable into a double word [ADRSET D0 D100]and then Add 10 to D100 (pointer to D10) then call function [MOV @D00 D30] will move the value in D10 into D30.
This works in ladder but does not work in FBD even though we are using the equivalent functions as it comes up with a compile error(s). I have tried to find why the @ symbol is not a valid character in FBD but to no avail, I wonder if anyone out there has the answer. There are differences in ladder to FBD for example in FBD to do a move or maths function then they are MOV 1234 to Dxx or EMOVE 1.23 Dxx where in ladder they are MOV K1234 to Dxx or EMOVE E1.23 Dxx so in FBD use direct numbers but in ladder use K for int, E for floats etc.
See pics.
There are two ways to indirectly address memory areas in Mitsubishi PLC's.
Using the index registers Z0-Z15, these act as pointers to an offset in the Z register so for example if 10 is put in the Z0 register then you do a move
[MOV 1234 D0Z0] it will move the value 1234 into D0+10 (D10), however, the other way is to use the ADRSET function, this moves the actual address of the variable into a double word [ADRSET D0 D100]and then Add 10 to D100 (pointer to D10) then call function [MOV @D00 D30] will move the value in D10 into D30.
This works in ladder but does not work in FBD even though we are using the equivalent functions as it comes up with a compile error(s). I have tried to find why the @ symbol is not a valid character in FBD but to no avail, I wonder if anyone out there has the answer. There are differences in ladder to FBD for example in FBD to do a move or maths function then they are MOV 1234 to Dxx or EMOVE 1.23 Dxx where in ladder they are MOV K1234 to Dxx or EMOVE E1.23 Dxx so in FBD use direct numbers but in ladder use K for int, E for floats etc.
See pics.