Host Engineering Forum

General Category => General Discussion => Topic started by: HB_GUY on February 05, 2016, 01:21:47 PM

Title: REFWRITE
Post by: HB_GUY on February 05, 2016, 01:21:47 PM
I am trying to understand when and why I would use the REFWRITE / REFREAD commands in an application in place of directly loading the value to the memory location in the Do-More line of controllers...
I can already do something like R[D10] to load into the R memory type at offset value of D10
Was this added for compatibility with older applications (Directsoft?)

Thanks.
Title: Re: REFWRITE
Post by: BobO on February 05, 2016, 01:34:49 PM
In the same way that an array reference allows you to indirectly reference items in a block, the REFxxx functions allow you to take that to the next level, indirectly referencing the block itself. Example: If you were to create a task block to sort a group of numbers, you could use REFxxx to access the memory, allowing you to abstract the block that the task operated on. You would then simply plug the target block number, then invoke the task.
Title: Re: REFWRITE
Post by: HB_GUY on February 05, 2016, 01:44:16 PM
Got It! Yea, that makes sense.
That is a pretty powerful command...
Thanks!