MoveBlock

PLCopen motion icon

 Function - Move / Copy items of an array.

Inputs

Input

Data Type

Range

Unit

Default

Description

DST

ANY (*)

 

 

 

Array containing the destination of the copy.

NB

DINT

 

 

 

Number of items to be copied.

PosDST

DINT

 

 

 

Index of the destination in DST.

PosSRC

DINT

 

 

 

Index of the first character in SRC.

SRC

ANY (*)

 

 

 

Array containing the source of the copy.

(*) SRC and DST cannot be a STRING.

Outputs

Output

Data Type

Range

Unit

Description

OK

BOOL

FALSE, TRUE

 

TRUE if successful.

Remarks

  • Arrays of string are not supported by this function.
  • 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 this case, the function avoids lost items when source and destination areas overlap.
  • This function verifies 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.

FBD Language Example

FFLD Language Example

  • In the FFLD Language, the operation is executed only if the input rung (EN) is TRUE.

IL Language Example

Not available.

ST Language Example

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