Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: franji1 on October 09, 2012, 05:42:44 PM
-
The Ladder Palette and Instruction Box Browser show all the Assignment instructions:
INIT, MAPIO, MEMCLEAR, MEMCOPY, MOVE, MOVEBIT, MOVER, PUBLISH, REFWRITE, RSTR, SETNUMR, SETR, SUBSCRIB
and it's as clear as mud which one of those you need to use. ::)
Most of the Assignment instructions copy VALUEs. The MEMCOPY instruction was created for BLIND BYTE COPIES, including copying STRUCTs, since STRUCT's do not have a "numeric value". MEMCOPY is also the fastest of the "assignment" instructions for bulk copy of raw memory (e.g. DATETIME structures or copying a range of V to another range of V).
The other assignment instructions typically "load" the "value" into the internal accumulator then "writes" the "value" into the format of the output (e.g. V0 to R10 will convert the V0 integer VALUE to its real VALUE and output that to R10, so integer 1 gets converted to real 1.0).
So, if you want to copy a time stamp into UDT0 (User Date/Time block, index 0) with $Now (system nickname for SDT0), do a
MEMCOPY of $Now to UDT0
with a "Number of Elements" set to 1.