L9_COMP: Complement a Matrix
(Original Document)
Naming
Name in LL984 Editor
Function Block Name
name of legacy 984 instruction
name in other tools and editors like:
  • Type Library Browser
  • Data Editor
  • Animation Tables
  • Search Results
Function Description
The L9_COMP procedure complements the bit pattern, i.e. changes all 0’s to 1’s and all 1’s to 0’s, of a source matrix, then copies the complemented bit pattern into a destination matrix. The entire COMP operation is accomplished in one scan.
NOTE: The L9_COMP procedure will not write to and change the state of any BOOL that has been forced in the Control Expert Animation Table.
Both the source and destination matrices consist of 16-bit sequences of outputs located in %M or %MW memory, depending on the respective procedure. The LENGTH value determines the number of 16-bit sequences included in the Boolean COMP operation. The location of the source matrix is defined by the SOURCE offset value, and the location of the destination matrix is defined by the DEST offset value.
The Boolean COMP operation begins when the input to the ENABLE pin is turned ON. Each bit in the source matrix is inverted and written to the corresponding bit in the destination matrix. L9_COMP can activate a single output. The OUT output turns ON upon the successful completion of the operation.
Representation
Parameters
Inout Pin
Name
Data Type
Address Range
Meaning
Top
ENABLE
OFF to ON initiates the operation.
Node
Node Type
Name
Data Type
Address Range
Meaning
Top
IN
SOURCE
ANY_ARRAY_UINT or ANY_ARRAY_EBOOL
%M, %I, %IW, %MW
The source matrix as an ARRAY OF UINT or BOOL, can be located or unlocated.
Middle
IN/OUT
DEST
ANY_ARRAY_UINT or ANY_ARRAY_EBOOL
%M, %MW
The destination matrix as an ARRAY OF UINT or BOOL, can be located or unlocated.
Bottom
IN
LENGTH
UINT
1...100
length of data matrix (number of 16 bit sequences)
Valid range: 1 to 100.
Output Pin
Name
Data Type
Address Range
Meaning
Top
OUT
BOOL
ON indicates the COMP operation succeeded. (Echoes the status of the ENABLE input).