Matrix - Create

This function block creates a new matrix MY with a determined dimension and initialized with the value at input X.

The initialization will only be done if the Trigger input is set to HIGH. If the Trigger is LOW, the current content of the matrix will not be changed.

Parameters

The parameter dialog can be used to select a data type and to assign the dimension of the matrix. The number of rows and columns can be set to a value between 1 and 9999 each.

Signals

Name I/O Type(s) Function
X I Data type independent Initial value
Trigger I BIT Initialize matrix
MY O Data type independent Output matrix

Visualization

The dimension of the matrix is shown in the form of rows x columns in the down right corner of the function block symbol.

Comments

When choosing a dimension of the matrix, it has to be considered, that a matrix can easily consume large parts of the system memory and therefore can disrupt its proper function. Large matrices can also result in very time consuming operations. The increase of the cycle time may help overcome timing problems.

At the start of a program all matrix elements are set to 0. With the first processing of the function block the appointed init value will be set. If the Trigger input is set to LOW from the beginning, the matrix is filled with 0.

If no connection exists at the output another data type can be assigned by creating a new connection on input X.

If the data type is changed by the parameter dialog all invalid connections will be deleted.