Topic: DMD0423 COPY - Copy Data |
|
The Copy Data (COPY) instruction copies the source data values to the destination locations. The instruction contains up to 50 rows, with each row containing one copy data operation. Each time the instruction is executed, all of the copy operations are performed in the order they are listed in the instruction.
Generally speaking, a copy operation can copy a single constant value to one or more sequential locations, or copy the data in one sequential range of locations to a different sequential range of locations. There are some caveats based on the data type which are discussed in the parameter section below and will be enforced by the instruction editor.
Note: pay attention to the Red / Green dot in the upper right corner of the instruction editor. If the dot is green all of the currently entered rows are correct. If the dot is red there's a problem with one or more of the rows; you can press the Return key to get a detailed explanation of what is wrong with the contents of the rows.
Row Editor Keys:The following functions are used to add or remove rows, edit existing rows or reorganize the rows in the instruction: OK closes the editor, saving any changes / Cancel closes the editor, discarding any changes. Insert inserts an empty row before the currently selected row / Remove deletes the currently selected row. Move Up / Move Downmoves the currently selected row up one row or down one row respectively.
|
|
Parameters:Note: Use the F9 key or click the 'three dot box' at the right edge of the parameter field 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.
Source is the constant value, memory location, structure or string that contains the data to be copied. Casts are allowed.
Destination is the writable memory location (or first element in the range if multiple destination locations will be used). Casts are allowed.
Number of Elements specifies the number of sequential elements to copy. This can be any integer constant value that is within the range Source and Destination locations. Input Leg selects which of the following power-flow conditions will cause this instruction to run:
|
|
Ladder Display:
By default, this instruction will expand vertically to display all of the steps in the instruction. The displayed size of the instructions can be limited to a single line that displays the total number of line by setting the View -> Options -> Ladder Tab -> Lengthy Instructions... option to 'Display Short Summary'.
The resulting status display will be reduced to the following:
|
|
See Also:COPY - Copy Data
MAPIO - Map
Inputs and Outputs
REFWRITE
- Write Value Indirectly
STRCOPYR - Copy a Range of Strings
|
|
Rung Example:
|
|