FUNCTION_BLOCK M_ADD

Hover on a highlighted element
to pop up its description (if any).

Upon the occurrence of an event at the REQ input of an instance of the M_ADD function block type:

  1. If the value of the QI input is TRUE:
    1. If the number of rows in IN1 is equal to the number of rows in IN2, and the number of columns in IN1 is equal to the number of columns in IN2, then as shown in the normal_addition sequence above:
      • The size of OUT is adjusted if necessary to be equal to the size of IN1;
      • the matrix sum (IN1+IN2) is placed in OUT;
      • the value of the QO output is set to TRUE;
      • the value of the STATUS output is set to OK(0).
      • Arithmetic overflow and underflow are not detected.
    2. If the number of rows in IN1 is not equal to the number of rows in IN2, or the number of columns in IN1 is not equal to the number of columns in IN2, the value of the QO output is set to FALSE, the value of the STATUS output is set to ARRAY_SIZE_ERROR(13), and no change is made in the value of OUT, as shown in the array_size_error sequence above.
  2. If the value of the QI input is FALSE, the value of the QO output is set to FALSE, the value of the STATUS output is set to INHIBITED(1), and no change is made in the value of OUT, as shown in the addition_inhibited sequence above.

See the MATRIX_DEMO system configuration for an example of the use of an instance of this function block type.