Upon the occurrence of an event at the REQ
input of an
instance of the M_ADD
function block type:
-
If the value of the
QI
input isTRUE
:-
If the number of rows in
IN1
is equal to the number of rows inIN2
, and the number of columns inIN1
is equal to the number of columns inIN2
, then as shown in thenormal_addition
sequence above:-
The size of
OUT
is adjusted if necessary to be equal to the size ofIN1
; -
the matrix sum
(IN1+IN2)
is placed inOUT
; -
the value of the
QO
output is set toTRUE
; -
the value of the
STATUS
output is set toOK(0)
. - Arithmetic overflow and underflow are not detected.
-
The size of
-
If the number of rows in
IN1
is not equal to the number of rows inIN2
, or the number of columns inIN1
is not equal to the number of columns inIN2
, the value of theQO
output is set toFALSE
, the value of theSTATUS
output is set toARRAY_SIZE_ERROR(13)
, and no change is made in the value ofOUT
, as shown in thearray_size_error
sequence above.
-
If the number of rows in
-
If the value of the
QI
input isFALSE
, the value of theQO
output is set toFALSE
, the value of theSTATUS
output is set toINHIBITED(1)
, and no change is made in the value ofOUT
, as shown in theaddition_inhibited
sequence above.
See the MATRIX_DEMO
system configuration for an example of the use of an instance of
this function block type.