News:

  • September 01, 2026, 01:36:07 AM

Login with username, password and session length

Author Topic: Moving 16 control relays to V memory  (Read 12104 times)

Henryp

  • Hero Member
  • *****
  • Posts: 161
Moving 16 control relays to V memory
« on: November 12, 2013, 02:51:49 PM »
What Do-more instruction will allow me to move 16 control relays to V memory? In a DL PLC I could do a LD VC0 and then Out V10,000.

Thanks   

plcnut

  • Hero Member
  • *****
  • Posts: 815
    • premiersi.com
Re: Moving 16 control relays to V memory
« Reply #1 on: November 12, 2013, 02:56:00 PM »
MOVER:
Source: C0
Number elements: 16 Or whatever you need
Destination: V0:0
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
https://premiersi.com

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3843
    • Host Engineering
Re: Moving 16 control relays to V memory
« Reply #2 on: November 12, 2013, 02:57:37 PM »
OR Cast on 16 bit boundary:

C0:UW  (C0 thru C15 as Unsigned Word)
C0:SW  (C0 thru C15 as Signed Word)

There is a cast builder in the Element Browser (F9) to help learn the grammar for casting bits to larger things, or larger things to smaller things, along with changing data formats (C0:R looks at C0 thru C31 as a 32-bit, IEEE floating point REAL)

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6174
  • Yes Pinky, Do-more will control the world!
Re: Moving 16 control relays to V memory
« Reply #3 on: November 12, 2013, 03:23:11 PM »
...to add to current suggestions:

If the source data is BYTE, WORD, or DWORD aligned and of the appropriate length, as in the example to cited, use a MOVE with the appropriate cast.
If the source data is not aligned or not of an appropriate length, use the MOVER.

If it can be used, MOVE is significantly faster than MOVER.
"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

plcnut

  • Hero Member
  • *****
  • Posts: 815
    • premiersi.com
Re: Moving 16 control relays to V memory
« Reply #4 on: November 12, 2013, 03:24:14 PM »
If it can be used, MOVE is significantly faster than MOVER.

This is good to know.
Thanks!
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
https://premiersi.com

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6174
  • Yes Pinky, Do-more will control the world!
Re: Moving 16 control relays to V memory
« Reply #5 on: November 12, 2013, 03:30:19 PM »
If it can be used, MOVE is significantly faster than MOVER.

This is good to know.
Thanks!

Under the covers, MOVE is just a LD and an OUT...or in actual Do-more-ese, a PUSH and an OUTW...very quick. The MOVER is a much smarter instruction that does the work one element at a time, with overlap handling and bounds checking. MOVER will always work, but power and flexibility usually comes at a performance cost.
"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