This can be achieved using index registers DR,IR.
Prior to function block execution load the Index Register pointer with MOVR and the Data Register value using MOV.
Then MOV DR,IR to a memory location, I call this the scratchpad.
Within the function block declare a variable with the same memory address the scratchpad.
The FB variable can Internal OR In/Out.
If the variable is internal then you must use AT in the declaration.
After function block execution move data from the scratchpad back to the current memory address.
The DR pointer can be indexed to point to the next memory location you want the FB to act on.
For example, say you want the FB to modify single words of data starting at 3000.
Set the scratchpad as an unused data area, in this example 6000.
MOVR 3000 IR1. Set IR pointer to 3000
MOV &0 DR1. Set DR pointer to 0.
MOV DR1,IR1 6000 . Move data from offset DR1 of 3000 to the scratchpad 6000.
Now execute your function block on the scratchpad 6000.
After FB has executed MOV 6000 DR1,IR1. [This copies data from the scratchpad back to the current DR1,IR1 memory location]
Now increment DR1 by 1.
The next execution of the FB will now act on the next word and move data from 3001 to 6000.
I have used this technique to process STRINGS as ARRAYS within FB's.
In that case after loading the pointers I use the MOV$ DR1,IR1 3000 to move a string to the scratchpad.
Execute the FB and modify the scratchpad string.
Then MOV$ 3000 DR1,IR1
Just have to be careful that memory areas don't overlap and clear the scratchpad after each execution..