I /O A DDRESSING

I /O A DDRESSING

Throughout this text, we have mentioned that the programmable controller’s operation simply consists of reading inputs, solving the ladder logic in the user program memory, and updating the outputs. As we get more into PLC programming and the application of I/O modules, we will review the relationship between the I/O address and the I/O table, as well as how I/O addressing is used in the program.

Industrial Text & Video Company 1-800-752-8398

www.industrialtext.com

S ECTION Components The Memory System C HAPTER 2 and Systems

and I/O Interaction 5

The input/output structure of a programmable controller is designed with one thing in mind—simplicity. Input/output field devices are connected to a PLC’s I/O modules, which are located in the rack (the physical enclosure that houses a PLC’s supplementary devices). The rack location of each I/O device is then mapped to the I/O table, where the I/O module placement defines the address of the devices connected to the module. Some PLCs use internal module switches to define the addresses used by the devices connected to the module. In the end, however, all of the input and output connections are mapped to the I/O table.

Assume that a simple relay circuit contains a limit switch driving a pilot light (see Figure 5-17). This circuit is to be connected to a PLC input module and output module, as shown in Figure 5-18. For the purpose of our discussion, let’s assume that each module contains 8 possible input or output channels and that the PLC has a memory map similar to the one shown previously in Figure 5-15. The limit switch is connected to the number 5 (octal) terminal of the input module, while the light is connected to the number 6 (octal) terminal of the output module.

Hardwired Logic

Figure 5-17.

A relay circuit with a limit switch driving a pilot light.

Let’s assume that, due to their placement inside the rack, the I/O modules’ map addresses are word 0000 for the input module and word 0010 for the output module. Therefore, the processor will reference the limit switch as input 000005, and it will reference the light as output 001006 (i.e., the input is mapped to word 0000 bit 05, and the output is mapped to word 0010 bit 06). These addresses are mapped to the I/O table. Every time the processor reads the inputs, it will update the input table and turn ON those bits whose input devices are 1 (ON or closed). When the processor begins the execution of the ladder program, it will provide power (i.e., continuity) to the ladder element corresponding to the limit switch, because its reference address is 1 (see Figure 5-18). At this time, it will set output 001006 ON, and the pilot light will turn ON after all instructions have been evaluated and the end of scan (EOS)—where the output update to the module takes place—has been reached. This operation is repeated every scan, which can be as fast as every thousandth of a second (1 msec) or less.

Industrial Text & Video Company 1-800-752-8398

www.industrialtext.com

S ECTION Components The Memory System C HAPTER 2 and Systems

and I/O Interaction 5

Output Address

Word Address

Figure 5-18. Input/output module connected to field devices.

Note that addresses 000005 and 001006 can be used as often as required in the control program. If we had programmed a contact at 001006 to drive internal output 002017 (see Figure 5-19), the controller would turn its internal output bit (002017) to 1 every time output 001006 turned ON. However, this output would not be directly connected to any output device. Note that internal storage bit 002017 is located in word 0020 bit 17.

Figure 5-19. PLC ladder implementation of Figure 5-17 using an internal output bit.

Industrial Text & Video Company 1-800-752-8398

www.industrialtext.com

S ECTION Components The Memory System C HAPTER 2 and Systems

and I/O Interaction 5

5 -6 S U M M A RY OF M E M O RY , S CANNING , AND

I /O