TLIs (Ladder Instructions) |
This driver includes a pair of Ladder Logic instructions, called TLIs. For TOPDOC online, these instructions are automatically added to the instruction menu the moment you go online to a SoftPLC that has the KTX.TLM installed.
Both instructions work with a block of 32 integer words. Each of the 32 words corresponds to a logical I/O rack, whose number is given by the rack adapter switch settings. Remember, field I/O racks may be placed in any I/O image table location due to the flexibility of KTX.LST. The TLIs use the rack numbers as they are determined by adapter switch settings, not the mapped logical addresses in the KTX.LST file.
For example, rack octal 017 (decimal 15), would be mapped to the sixteenth word in the block.
KTXGETFAULTMAP | ||
This instruction copies a bitmap of faulted I/O adapters for a particular KTX card into the datatable. This instruction is a permissive instruction, and evaluates as TRUE only if an adapter is faulted. It can be used as a condition for invoking a JSR or setting a summary alarm bit in the same rung. It only writes to the indicated bits and no others. It takes two parameters.
The following example uses a TRUE evaluation result, indicating at least one faulted rack, to turn on bit S6/11 which will then fault SoftPLC.
Parameter Name | Description |
---|---|
CardNum | is the zero based index into your [CARDS] section of the KTX.LST file. That is, it refers to a particular card. Zero is the first card, 1 is the second card, etc. |
Map | is the start of a 32 word block that will receive the faulted rack adapter bitmap. The format of the bitmap is given below. Each of the 32 words corresponds to a logical rack. |
The Map will always be set to zeros unless an I/O rack adapter is faulted. Also, remember from earlier that when an I/O rack adapter is faulted S15 is set to 5324 by the KTX.TLM independent of this TLI. S15 is not ever cleared by the KTX.TLM, you must do that in logic. Only the least significant 4 bits of each word make up the map:
This bit when set | Corresponds to a fault in |
---|---|
0 | first 1/4 rack starting I/O group 0 |
1 | second 1/4 rack starting I/O group 2 |
2 | third 1/4 rack starting I/O group 4 |
3 | fourth1/4 rack starting I/O group 6 |
KTXRACKEXISTS | ||
This insruction copies a bitmap of existing I/O adapters for a particular KTX card into the datatable. Immediately after loading each KTx card with its firmware, the firmware goes out and detects the existence of racks on the RIO cabling. This instruction is an output instruction. It can be used to fetch the findings of a KTX card/channel. It only writes to the indicated bits and no others. It takes two parameters:
Parameter Name | Description |
---|---|
CardNum | is the zero based index into your [CARDS] section of the KTX.LST file. That is, it refers to a particular card. Zero is the first card, 1 is the second card, etc. |
Map | is the start of a 32 word block that will receive the existence status bitmap. The format of the bitmap is given below. Each of the 32 words corresponds to a full rack. |
Below is the layout of the 32 Map words. Only bits 8, 9, 10, and 11 are part of this map:
This bit when set | Corresponds to the existence of |
---|---|
8 | first 1/4 rack starting I/O group 0 |
9 | second 1/4 rack starting I/O group 2 |
10 | third 1/4 rack starting I/O group 4 |
11 | fourth 1/4 rack starting I/O group 6 |