MOVEBLOCKPLCopen motion icon

FunctionClosed A function calculates a result according to the current value of its inputs. A function has no internal data and is not linked to declared instances. - Move/Copy items of an array.

Inputs

SRC: ANY (*)   Array containing the source of the copy
DST : ANY (*)  Array containing the destination of the copy
PosSRC: DINT   Index of the first character in SRC
PosDST : DINT  Index of the destination in DST
NB : DINT     Number of items to be copied

(*) SRC and DST cannot be a STRING

Outputs

OK : BOOL        TRUE if successful

Remarks

Arrays of string are not supported by this function.

In FFLD language, the operation is executed only if the input rung (EN) is TRUE. The function is not available in ILClosed "Instruction list" This is a low-level language and resembles assembly language.

The function copies a number (NB) of consecutive items starting at the PosSRC index in SRC array to PosDST position in DST array. SRC and DST can be the same array. In that case, the function avoids lost items when source and destination areas overlap.

This function checks array bounds and is always safe. The function returns TRUE if successful. It returns FALSE if input positions and number do not fit the bounds of SRC and DST arrays.

ST Language

OK := MOVEBLOCK (SRC, DST, PosSRS, PosDST, NB);

FBD Language

FFLD Language

(* The function is executed only if EN is TRUE *)

IL Language

Not available