Matrix – Copy data

This function block copies elements from the source matrix MSrc into the destination matrix MDst.

The input signals xDest and yDest define the starting position for writing into the destination. The signals xSrc and ySrc define the starting position for reading from the source. The input signals nCols and nRows determine the number of columns and rows to copy. If this function can only read less columns or rows than requested by nCols or nRows the remaining positions are filled with 0 until the desired number of columns and rows are written (or the last column/row is reached in the destination matrix). The output signals nCpCols and nCpRows give the number of really written columns and rows respectively.

The source and the destination can be the same matrix; therefore it is possible to copy elements within a matrix.

Signals

Name I/O Type(s) Function
MDest I/O Data type independent Destination matrix
xDest I WORD Index for the starting column at the destination
yDest I WORD Index for starting row at the destination
MSrc I datentypunabhängig Source matrix
xSrc I WORD Index ab welcher Spalte aus der Quellmatrix gelesen wird
ySrc I WORD Index for the starting column at the source
nCols I WORD Number of columns to copy
nRows I WORD Number of rows to copy
nCpCols O WORD Number of written columns
nCpRow O WORD Number of written rows

Comments

The first row/column of the matrix has the index of 0.

A negative index is allowed. In this case the first |xDest| column or |yDest| rows read from the source will be ignored and/or the first |xSrc| columns or |ySrc| rows written to the destination will set to 0.

If there is no destination matrix connected a warning will be given before the download and this function block will not operate.