PLC-5/250: indirect addresses
You can substitute a component within a logical address with the value in another address. This is called indirect addressing. The processor uses the value from the substituted address to form the indirect address. You can use ladder logic to change the value stored at the substitute address. For example: 1N[1N8:6]:0. Note that you cannot use indirect addressing with the
I
, O
, or S
file types.Use indirect addressing for applications such as indexing sequential batch files in a multiple batch operation. For example, at completion of each operation, let a counter accumulated value call out the next batch file, such as
1N10
, 1N11
, 1N12
, 1N13
, &ldots; 1N[1C5:0.ACC]
.When you specify indirect addresses, follow these guidelines:
- You can indirectly address these address components:
- File number
- Element number
- Sub-member
- Bit numberYou cannot specify indirect addresses to the bit level. For example,1N7:[I:017/03]is invalid, but1N7:[I:017]is valid.
- The substitute address must be one of the following types: N, L, B, I, O, IS, BTD, and SD. Any AS, BR, BW, C, R, ST, and T addresses must be a sub-member address, such as 1T4:0.ACC.
- Enter the substitute address in brackets ([ ]).
- Substitute addresses must reside in the same LP module as the base address, or in the RM module. An invalid address, such as 1F[2N:0]:0 results in a processor fault.
The following table shows examples of indirect addresses.
Address: | Variable: | Explanation: |
---|---|---|
2F[2N3:0] | File number | The file number is stored in integer address 2N3:0. |
1N3:[1C07.ACC] | Word number | The word number is stored in counter 7's accumulated value. |
1F[1N4:0]:[1N4:1] | File and word number | The file number is stored in integer address 1N4:0 and the word number is stored in integer address 1N4:1. |
B3/[1:017] | Bit number | The bit number is stored in input word 17. |
Provide Feedback