L9_BLKT: Block to Table
(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_BLKT block-to-table procedure combines the functionality of a block move procedure with a register to table procedure. In a single scan, it can copy data from a source block to a destination block in a table. The length of the source block is fixed.
Both the source block and destination table consist of arrays of UINT words located in %MW memory or in unlocated memory. The LENGTH value determines the number of words included in the source block. The SOURCE parameter defines the location of the first word in the source block of words.
The DEST parameter defines the location of the pointer word. The pointer word contains an integer value which, when multiplied against the LENGTH value, points to the first word in the block of words the L9_BLKT procedure will overwrite. The initial value of the pointer word is 0, which points to the word contiguous to and immediately following the pointer word. Each destination block contains the same number of words as the source block, as defined by the LENGTH value.
NOTE:
The destination table is segmented into a series of blocks, each of which is the same length as the source block.
  • If the destination table is located at %MW memory, the size of the destination table does not have to be parametrized. It is only limited by the number of memory words (%MW) in your system configuration.
  • If the destination table is in unlocated memory, the destination table length must be defined by the array size of DEST. The array size of DEST must be a multiple of LENGTH + one word for the table pointer.
The operation begins when the input to the ENABLE pin is turned ON. If both the HOLD and RESET inputs remain OFF during operation, the pointer word will increment by a value of 1 after each scan, causing the operation to move to the next adjacent block of words within the destination table.
The operation continues to copy the values of the source block words to a series of contiguous destination blocks until the operation reaches the end of the table. If the HOLD input turns ON, the pointer word stops incrementing and the operation continues to overwrite the same destination block of words. If the RESET input turns ON, the pointer word is reset to 0, and the operation moves to the first block of words in the destination table.
The OUT output turns ON upon the successful completion of the operation. The ERR output indicates the attempted move operation is not possible.
L9_BLKT is a powerful function block that can write to all the %MW memory words in your PLC with data copied from the source block.
WARNING
CORRUPTED DATA
Use external logic in conjunction with the middle or bottom input to confine the value in the pointer to a range of memory words that has been determined to be safe in your application.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
Representation
Parameters
Input Pin
Name
Data Type
Address Range
Meaning
Top
ENABLE
OFF to ON initiates the operation.
Middle
HOLD
BOOL
ON= hold pointer
OFF= increment pointer
Bottom
RESET
BOOL
ON= reset pointer to zero
Node
Node Type
Name
Data Type
Address Range
Meaning
Top
IN
SOURCE
ANY_ARRAY_UINT
%MW
The source block declared as ARRAY[1..x] OF UINT, where x is the value of LENGTH.
Middle
IN/OUT
DEST
ANY_ARRAY_UINT
%MW
The pointer word followed by a sequence of blocks, each of which has the same size as the source block. To be declared as ARRAY[1..(n*LENGTH)+1] OF UINT, where n is the count of blocks in the destination table and LENGTH is the value of the LENGTH parameter. The result of (n*LENGTH)+1 is represented as a constant.
Bottom
IN
LENGTH
UINT
1...100
The number of words to be included in the operation.
Valid range: 1 to 100.
Output Pin
Name
Data Type
Address Range
Meaning
Top
OUT
BOOL
ON indicates the operation succeeded.
Middle
ERR
BOOL
ON indicates the attempted operation is not possible.
Example
See below an example of L9_BLKT usage.
The source block is 5 words long (%MW10...%MW14).
The destination table starts at %MW21 and is segmented into a string of 5-word blocks (%MW21...%MW25, %MW26...%MW30, etc.).
In the graphic below, you see what happens on the second transition of positive transition (P.T.) contact %I1.
The value inside the pointer (%MW20) increments to 1, and the data contained in the source block words is copied into the second block in the destination table (%MW26...%MW30).
Coil %M1 goes ON when the L9_BLKT move is completed.
The L9_SUB function block is used to control the use of words in the destination table. Here you restrict the table to 15 (3*5) words by clearing the value in the pointer word to 0 after 5 L9_BLKT transfers.