Vector – Copy data
This function block copies elements from the source vector VSrc into the destination vector VDest.
The position to start reading elements from the source is determined by ISrc. The position to start writing elements in the destination is given by IDest. The number of elements to copy is given by nElem. If this function can only read less elements from the source than requested by nElem, the remaining positions are filled with 0 until nElem elements are written to the destination (of the destination vector ends). The output nCpElem contains the number of really written elements.
The source and the destination can be the same vector; therefore it is possible to copy elements within a vector.
|VDest||I/O||Data type independent||Destination vector|
|IDest||I||WORD||Starting index for writing into the destination|
|VSrc||I||Data type independent||Source vector|
|ISrc||I||WORD||Starting index for reading from source|
|nElem||I||WORD||Number of elements to copy|
|nCpElem||O||WORD||Number of written elements|
The first element of the vector has the index of 0.
A negative index is allowed. In this case the first |IDest| elements read from the source will be ignored or the first |ISrc| elements of the destination will set to 0.
If there is no destination vector connected a warning will be given before the download and this function block will not operate.
The data type can be assigned by connecting one of the vector input signals.