News:

  • June 11, 2026, 10:13:28 PM

Login with username, password and session length

Author Topic: REFWRITE  (Read 7594 times)

HB_GUY

  • Full Member
  • ***
  • Posts: 43
REFWRITE
« 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.
« Last Edit: February 05, 2016, 01:32:27 PM by HB_GUY »

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6158
  • Yes Pinky, Do-more will control the world!
Re: REFWRITE
« Reply #1 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.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

HB_GUY

  • Full Member
  • ***
  • Posts: 43
Re: REFWRITE
« Reply #2 on: February 05, 2016, 01:44:16 PM »
Got It! Yea, that makes sense.
That is a pretty powerful command...
Thanks!