Topic: DMD0007

Help File Version: 2.9.4.37

MEMCOPY - Copy Memory Range


The Copy Memory Range (MEMCOPY) instruction is used to copy bytes of data from one range of memory locations to another range of memory locations without regard to the format of the data in the memory locations. No data conversion will be applied during the copy operation. The source and destination ranges can overlap which allows implementation of things like value shifting and LIFO / FIFO queues or stacks. The Copy Memory Range instruction is the proper instruction to copy structures - for example Date / Time structures - making it especially useful in moving structures into and out of Guest Protocol MemoryThese are blocks of memory specically created for the use by the Do-more controller to handle external communication devices. For example the MI, MC, MIR and MHR memory blocks for communicating with Modbus clients, and DLX, DLY, DLC and DLV memory blocks for communicating with DirectLOGIC clients..

 

 

To move one or more memory locations with regard to the data format, consider using the MOVE - Move Value or MOVER - Move Range of Values instruction.

 


Parameters:

Note: Use the F9 key to open the Default Element Selection Tool (the Element Picker or the Element Browser) or use the Down-Arrow key (Auto-Complete) on any parameter field to see a complete list of the memory locations that are valid for that parameter of the instruction.

 

Start of Source - specifies the first memory location of the data to copy. This can be any readable location (including structures).

 

Start of Destination - specifies the first memory location of the where the data is to be copied. This can be any writable location (including structures).

 

Range - specifies the number of bytes of data to copy by selecting one of the following five options:
 

  • End of Source - calculates the number of bytes by specifying the last memory location in the range of values to copy. This memory location must be in the same block as the Start of Source, and the ID of the end memory location must be greater than the ID of the source memory location.
     

  • Number of Source Elements - calculates the number of bytes by specifying the number of source elements in the range. This can be any constant value up to the number of memory locations in the block, or any readable numeric location.
     

  • Number of Bytes - specifies the number of bytes of data to copy. This can be any constant value up to the number of bytes of memory in the block, or any readable numeric location.
     

  • Number of Destination Elements - calculates the number of bytes by specifying the number of destination elements in the range. This can be any constant value up to the number of memory locations in the destination data block, or any readable numeric location.
     

  • End of Destination - calculates the number of bytes by specifying the last memory location in the destination range. This memory location must be in the same block as the Start of Destination, and the ID of the end memory location must be greater than the ID of the source memory location.

 


Status Display:

 

The status display for the Copy Memory Range instruction will show the beginning and ending elements of the source and destinations ranges.

 


See Also:

INIT - Initialize Data

 

MEMCLEAR - Clear Memory Range

 

MEMCOPY - Copy Memory Range

 

MOVE - Move Value

 

MOVEBIT - Move Single Bit

 

MOVER - Move Range of Values

 

REFWRITE - Write Value Indirectly

 

RSTR - Reset Range

 

SETNUMR - Set Numeric Range

 

SETR - Set Range

 

STRCOPY - Copy String

 

STRCOPYR - Copy a Range of Strings

 


Rung Example: