LGF_MatrixScalarMultiplication (FC / V3.0.1)


Author: Siemens Digital Industries

Short description

This function block multiplies a matrix of the data type ARRAY[*,*] of LREAL with a scalar.

Example for 2x2 matrix:

B = b * A = \begin{bmatrix} b*a_{11} & b*a_{12} \\ b*a_{21} & b*a_{22} \end{bmatrix}

A matrix is multiplied by a scalar, thereby multiplying each matrix element by the scalar. The result is output in the matrixResult matrix.

Note
Note that the input and output matrix must have the same number of columns and rows.

Block Interface

LGF_MatrixScalarMultiplication (FC)
LReal  scalar Ret_Val  Void
    
   error  Bool
    
   status  Word
    
Array[*, *] of LReal  matrixInput  Array[*, *] of LReal
       
Array[*, *] of LReal  matrixResult  Array[*, *] of LReal
       
   

Input parameter

IdentifierData typeDescription
scalarLRealScalar value where the matrix is multiplied

Output parameter

IdentifierData typeDescription
Ret_ValVoidVoid - Function has no return value
errorBoolFALSE: No error
TRUE: An error occurred during the execution of the FB
statusWord16#0000-16#7FFF: Status of the FB
16#8000-16#FFFF: Error identification (see following Table)

In/Out parameter

IdentifierData typeDescription
matrixInputArray[*, *] of LRealMatrix to multiply
matrixResultArray[*, *] of LRealThe result matrix of the multiplication

Status & Error codes

Code / ValueIdentifier / Description
16#0000STATUS_NO_ERROR
Execution finished without errors
16#8201ERR_MATRICES_LOWER_BOUND_ROWS_DONT_MATCH
Error: Matrices lower bound rows(Dim1) do not match
16#8202ERR_MATRICES_UPPER_BOUND_ROWS_DONT_MATCH
Error: Matrices upper bound rows(Dim1) do not match
16#8203ERR_MATRICES_LOWER_BOUND_COLUMNS_DONT_MATCH
Error: Matrices lower bound columns(Dim2) do not match
16#8204ERR_MATRICES_UPPER_BOUND_COLUMNS_DONT_MATCH
Error: Matrices upper bound columns(Dim2) do not match

Change log

Version & DateChange description
01.00.00Simatic Systems Support
11.12.2019First released version
based on "LGF_MatrixMultiplication"
03.00.00Simatic Systems Support
23.04.2020Set version to V3.0.0, harmonize the version of the whole library
03.00.01Simatic Systems Support
02.02.2020Insert documentation