Some time ago, I looked at a form of indirect addressing on Q series PLC's, the normal way is to use the "Z" registers as an indirect pointer, so for example:
[Move 10 Z0] // load the index register with a constant of 10
[Move D0Z0, D100] //move D10 (D0 with offset of Z0 (10)) to D100
Fine it works as expected.
However, there is another way with a function called ADRSET, so the code
ADRSET[D0,D100] //get the actual address of D0 & store in D100
ADD[10,D100,D100] // Add an offset of 10 to the address in D100
MOV[ @D100, D102] // move the contents of the register (D0 +10 (D10) to D102
Works ok in GXDeveloper or GXWorks2 Ladder.
However, in GXWorks2 in FBD there is a function called ADRSET but cannot use the "@" symbol in a variable. see code, it will not compile:
Now have looked in the help files & in the functions list but no answers, has anybody tried this, is it a bug in the FBD if so, why include the ADRSET function if you cannot use it, or is it just there is some other instruction that is the equivelent of the @ in FBD, if so I cannot find any information on it in the help or on-line.
The pic shows the two ways, ladder compiles ok & runs, FBD does not.
[Move 10 Z0] // load the index register with a constant of 10
[Move D0Z0, D100] //move D10 (D0 with offset of Z0 (10)) to D100
Fine it works as expected.
However, there is another way with a function called ADRSET, so the code
ADRSET[D0,D100] //get the actual address of D0 & store in D100
ADD[10,D100,D100] // Add an offset of 10 to the address in D100
MOV[ @D100, D102] // move the contents of the register (D0 +10 (D10) to D102
Works ok in GXDeveloper or GXWorks2 Ladder.
However, in GXWorks2 in FBD there is a function called ADRSET but cannot use the "@" symbol in a variable. see code, it will not compile:
Now have looked in the help files & in the functions list but no answers, has anybody tried this, is it a bug in the FBD if so, why include the ADRSET function if you cannot use it, or is it just there is some other instruction that is the equivelent of the @ in FBD, if so I cannot find any information on it in the help or on-line.
The pic shows the two ways, ladder compiles ok & runs, FBD does not.