I appear to have caused offence, for which, I am sorry; that was not my intent. I meerly wished to offer advice, you can of course ignore it. Perhaps you took my meaning too literally.
Ultimately, you always need to reference a real address at some point but the point I was trying to convey was that of code re-useability. Considder having 10 drives all the same, if you hard code everything you end up with 10 FCs but you could have only one FC called 10 times and pass it a UDT. This might seem like a lot of trouble and just as much work as writing 10 FCs but when you want to change how the drive is controlled then you only have to change it once and not ten times.
It's always "horses for courses" and there is almost always more than one way of doing something.
and for the record yes I often use sfc20 with dynamically generated anypointers for the source and destination.
I'm always open to new ideas but I've also fallen down a few holes in my time.
Nick
Nick, no offense taken. I think we are both saying similar things in different ways.
I agree with your 10 FC situation completely, I might even go a step further and suggest using a global DB for all the memory used in the FC so it is really portable to other processors. I would definitely not use marker memory inside a FC if I intend to use it more than once. I much prefer re-usable blocks.
There are times though when the code uses an FC as a segregation tool to make sections of code that are unique.
I am currently writing a block to do some logic with data bits from a DB. The result is then written out. And the FC or FBs will be used 4 or 5 times in each of 5 machines. This is what spurred the search for a better blkmov.
I discovered the STL command DINO which will allow me to grab the data from a DB which I pass as a parameter into the block, then copy the data to the current FBs STAT area, then use the STAT bits for the logic in the block and write the result to an OUT.
Next usage will only need to have the location of the next DB passed into it as an INT.
Repeat 4 or 5 times for this machine. Then take it over to the next. By using an FB and the contained STAT area, I control the memory, and bring it with me when the block is created. And no edits are required inside the block to change the location of the instance db used in each case.
The FB is less than 20 networks long, but times 5 and times 5 leaves room for error. Sounds like we agree on this method, as I am sure many do.
Thanks for your feedback.