Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Henryp 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
-
MOVER:
Source: C0
Number elements: 16 Or whatever you need
Destination: V0:0
-
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)
-
...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.
-
If it can be used, MOVE is significantly faster than MOVER.
This is good to know.
Thanks!
-
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.