FUNCTION_BLOCK M_OPS

An instance of this Function Block type contains an output MATRIX B . Upon the occurrence of an event at the REQ input with QI = true, an operation indicated by the OP input (a value of the enumerated M_OP data type) is performed as indicated in the table below, followed by an event at the CNF output.
  • If the operation succeeds, the QO output is set true and the STATUS output is set to 0 (OK).
  • If the operation fails, the QO output is set false, the STATUS output indicates the reason for the failure as indicated in the table below, and the B and Y outputs remain unchanged, except in the following case:
    • When OP = M_OP#INIT, a syntax error in the IVAL input will cause the B output to be the zero matrix of M rows and N columns.
  • If QI = FALSE upon the occurrence of an REQ event, the QO output is set false, the STATUS output is set to 1 (INHIBITED), and the B and Y outputs remain unchanged.
See the M_OPS_DEMO system configuration for an interactive demonstration of these features.
OP, e.g., M_OP#ZERO Normal Result STATUS value when QO = false
ZERO B = M×N zero-filled matrix None
IDENT B = M×M Identity Matrix None
INIT Reset B to an M×N zero matrix, then initialize from IVAL TYPE_CONVERSION_ERROR(2) if an error occurs in parsing IVAL
COPY Copy A to B None
GET Y = Bij INVALID_SUBSCRIPT(12) if (I≥B.rowCount) | (J≥B.columnCount)
PUT Bij = X Same as above
APPEND_ROW Append row I of A to rows of B INVALID_SUBSCRIPT(12) if (I≥A.rowCount)
ARRAY_SIZE_ERROR(13) if (A.colCount≠B.colCount) | (B.rowCount=255)
APPEND_COL Append column J of A to columns of B INVALID_SUBSCRIPT(12) if (J≥A.columnCount)
ARRAY_SIZE_ERROR(13) if (A.rowCount≠B.rowCount) | (B.colCount=255)
DELETE_ROW Delete row I of B INVALID_SUBSCRIPT(12) if (I≥B.rowCount)
DELETE_COL Delete column J of B INVALID_SUBSCRIPT(12) if (J≥B.columnCount)
INS_ROW Insert row I of A
at row J of B
INVALID_SUBSCRIPT(12) if (I≥A.rowCount) | (J≥B.rowCount)
ARRAY_SIZE_ERROR(13) if (A.columnCount≠B.columnCount )| (B.rowCount=255)
INS_COL Insert column I of A
at column J of B
INVALID_SUBSCRIPT(12) if (I≥A.columnCount) | (J≥B.columnCount)
ARRAY_SIZE_ERROR(13) if (A.rowCount≠B.rowCount) | (B.columnCount=255)
REPL_ROW Replace row J of Bwith row I of A INVALID_SUBSCRIPT(12) if (I≥A.rowCount) | (J≥B.rowCount)
ARRAY_SIZE_ERROR(13) if (A.columnCount≠B.columnCount)
REPL_COL Replace column J of Bwith column I of A INVALID_SUBSCRIPT(12) if (I≥A.columnCount) | (J≥B.columnCount)
ARRAY_SIZE_ERROR(13) if (A.rowCount≠B.rowCount)
SWAP_ROWS Swap rows I and J of B INVALID_SUBSCRIPT(12) if (I≥B.rowCount) | (J≥B.rowCount)
SWAP_COLS Swap columns I and J of B INVALID_SUBSCRIPT(12) if (I≥B.columnCount) | (J≥B.columnCount)
INNER Y = Inner product of
row I of A
with column J of B
INVALID_SUBSCRIPT(12) if (I≥A.rowCount)|(J≥B.columnCount)
ARRAY_SIZE_ERROR(13) if (A.columnCount≠B.rowCount)
PIVOT Performs a PFI Pivot of column I from A
into B and places the pivot divisor in Y, using X as the zero limit on the pivot divisor.
ARRAY_SIZE_ERROR(13) if (A.rowCount≠B.columnCount) | (B.rowCount≠B.columnCount)
DIVISION_BY_ZERO(4) if ABS(Y)≤X
INV B = A-1
Y = det(A)
ARRAY_SIZE_ERROR(13) if (A.rowCount≠A.columnCount)
DIVISION_BY_ZERO(4) if ABS(Y)≤X
TRANS B = AT None
Last updated: 2015-08-25.
©2015 Holobloc Inc.. All rights reserved.