4.2 Operate the PLC
4.2.3. PLC Programming
Someone who can operate the PLC first he must already know what it is the PLC and how to program a PLC, so that can be operated to control a piece of equipment in accordance with what we want.
4.2.3.1. Introduction
A PLC (Programmable Logic Controller) is an equipment used to replace a series of relay circuit that found in conventional process control systems. PLC works by observing the input (via associated sensors), then do the process and take action as needed, in the form of turn on or turn off the output (logic 0 or 1, alive or dead). Users create a program (commonly called a ladder or ladder diagrams), which then must be executed by the PLC concerned. In other words, the PLC determines what action should be performed on instruments relating to the status output of a size scale observed. PLC is widely used in industrial applications, eg in the packaging process, material handling, automated assembly, elevator and many others.
The use of PLC has several advantages compared with conventional process control systems, among others:
a. The number of cables required can be reduced up to 80%;
b. PLC lower energy consumption
c. Diagnostic functions in a PLC controller allows fault detection more easy and fast;
d. Changes in operational sequence or a process or application can be done easily, just by making a change or replacement program, either through a console terminal or PC computer;
e. Does not require a lot of spare parts;
f. Cheaper, particularly in the case of the use of the instrument I / O are quite large and operational functions of process are fairly complex ;
g. PLC endurance is much better than the auto-mechanical relays.
4.2.3.2. Components of PLC
PLC is actually a special microcontroller system for industry, meaning a set of hardware and software adapted for used in industrial control applications. Basic elements of a PLC is shown in Figure 4.
Power Supply is used to provide power supply to all parts of the PLC (including CPU, memory, etc.). Most PLC is working with the power supply 24 VDC or 220 VAC. Power supply is usually integrated with the CPU but there are also separate in a separate unit. Power supply is also equipped with battery backup, so that in the event of power failure, the battery automatically replaces the main power supply to the CPU, so that the user program memory is not lost.
• Unit CPU (Central Processing Unit)
CPU or central processing unit is the brains of a PLC, which is typically a microcontroller 8 bits, 16 bits or 32 bits. CPU is in charge of communication with external devices, interconnectivity inter division of internal parts of the PLC, program execution, memory management, supervise or observe the input signal and provides output signals (in accordance with the process or program that executed). At the CPU is also equipped with indicator lights as an indicator of errors and damage.
• Unit Input / Output
Units of I / O is an interface unit which functions to convert or change the input signal and output signal to the CPU can communicate with external devices such as buttons, switches, sensors, electric motors, selenoid, relays, lamps and others.
• Memory Unit
Memory unit serves to store data and programs that will be used by the PLC. Memory is divided into two types, ROM and RAM. ROM contains data such as facility data logic programming, program editing facility, the facility monitors the program, facilities for communications and others. The data are stored permanently and will not be lost even if power supply is off. While the program data RAM data containing the user, such as ladder diagrams, data memory data, the status of I / O and others. The data can be written and read. RAM is not permanent, so if power suplply off the data that data will be lost. To avoid this, the power supply system equipped with a battery backup that will to power supply if the main power supply off. To store user data in addition to the RAM program data is now widely used EPROM (Eraseable Program Read Only Memory) and EEPROM (Electrical Eraseable Program Read Only Memory). The advantages of EPROM and EEPROM is readable and written many times, such as data stored on the RAM but will not be lost even if power supply is off like a ROM.
• Tools I / O
Equipment Input / Output is equipment associated with the Unit I / O. Examples of input devices are sensors, limit switches, buttons, selector and more, while examples of output devices are lights, selenoid, buzzer, motor relay, and others.
• Tools Programmers
Programming tools are tools used to insert, edit, modify and monitor existing programs in the PLC memory. This equipment is usually a computer or a Programming Console.
4.2.3.3. The working principle of PLC
A PLC works by continually scanning program. Supposing we could illustrate one scan cycle is to be 3 steps. Typically more than 3 but his outline there are 3 steps, as shown in Figure 6.
Description:
After step 3, the PLC will repeat its scanning program and iangkah 1, and so on. When a scan is defined as the time needed to work on these 3 steps. Each step can have a response time (response time) are different, the total time response or total response time is the sum of all response time of each step:
4.2.1 Applying Procedure of Health and Safety
During implementation of the work, procedures of Health and Safety must be implemented properly so that risk of the workplace accidents can be avoided. Following example application of procedure of Health and Safety at the workplace;• Using equipment of Health and Safety
Figure 4.2 equipment of Health and Safety
• Obeying the applicable safety instructions
4.2.2. Checking Installation and power supply of PLC
Before starting the operation, first checks that should be done to the PLC in accordance with manual instructions, usually include;
• Are all Unit of PLC and equipment of I/O has been installed correctly?
• Are all cables and connectors has been installed correctly in accordance with the wiring diagram and squeezed tightly ?
• Is there a screw is not tight?
• Is there a cable is snafu?
• Is there a connection of the cable is broken or not connect?
• Is the power cable connected correctly?
• Is the voltage of power supply was in accordance with the range?
Before starting the operation, first checks that should be done to the PLC in accordance with manual instructions, usually include;
• Are all Unit of PLC and equipment of I/O has been installed correctly?
• Are all cables and connectors has been installed correctly in accordance with the wiring diagram and squeezed tightly ?
• Is there a screw is not tight?
• Is there a cable is snafu?
• Is there a connection of the cable is broken or not connect?
• Is the power cable connected correctly?
• Is the voltage of power supply was in accordance with the range?
If everything is in good condition then the operation of the PLC can be started.
Someone who can operate the PLC first he must already know what it is the PLC and how to program a PLC, so that can be operated to control a piece of equipment in accordance with what we want.
4.2.3.1. Introduction
A PLC (Programmable Logic Controller) is an equipment used to replace a series of relay circuit that found in conventional process control systems. PLC works by observing the input (via associated sensors), then do the process and take action as needed, in the form of turn on or turn off the output (logic 0 or 1, alive or dead). Users create a program (commonly called a ladder or ladder diagrams), which then must be executed by the PLC concerned. In other words, the PLC determines what action should be performed on instruments relating to the status output of a size scale observed. PLC is widely used in industrial applications, eg in the packaging process, material handling, automated assembly, elevator and many others.
The use of PLC has several advantages compared with conventional process control systems, among others:
a. The number of cables required can be reduced up to 80%;
b. PLC lower energy consumption
c. Diagnostic functions in a PLC controller allows fault detection more easy and fast;
d. Changes in operational sequence or a process or application can be done easily, just by making a change or replacement program, either through a console terminal or PC computer;
e. Does not require a lot of spare parts;
f. Cheaper, particularly in the case of the use of the instrument I / O are quite large and operational functions of process are fairly complex ;
g. PLC endurance is much better than the auto-mechanical relays.
4.2.3.2. Components of PLC
PLC is actually a special microcontroller system for industry, meaning a set of hardware and software adapted for used in industrial control applications. Basic elements of a PLC is shown in Figure 4.
figure 4. Basic elements of a PLC
• Power Supply UnitPower Supply is used to provide power supply to all parts of the PLC (including CPU, memory, etc.). Most PLC is working with the power supply 24 VDC or 220 VAC. Power supply is usually integrated with the CPU but there are also separate in a separate unit. Power supply is also equipped with battery backup, so that in the event of power failure, the battery automatically replaces the main power supply to the CPU, so that the user program memory is not lost.
• Unit CPU (Central Processing Unit)
CPU or central processing unit is the brains of a PLC, which is typically a microcontroller 8 bits, 16 bits or 32 bits. CPU is in charge of communication with external devices, interconnectivity inter division of internal parts of the PLC, program execution, memory management, supervise or observe the input signal and provides output signals (in accordance with the process or program that executed). At the CPU is also equipped with indicator lights as an indicator of errors and damage.
• Unit Input / Output
Units of I / O is an interface unit which functions to convert or change the input signal and output signal to the CPU can communicate with external devices such as buttons, switches, sensors, electric motors, selenoid, relays, lamps and others.
• Memory Unit
Memory unit serves to store data and programs that will be used by the PLC. Memory is divided into two types, ROM and RAM. ROM contains data such as facility data logic programming, program editing facility, the facility monitors the program, facilities for communications and others. The data are stored permanently and will not be lost even if power supply is off. While the program data RAM data containing the user, such as ladder diagrams, data memory data, the status of I / O and others. The data can be written and read. RAM is not permanent, so if power suplply off the data that data will be lost. To avoid this, the power supply system equipped with a battery backup that will to power supply if the main power supply off. To store user data in addition to the RAM program data is now widely used EPROM (Eraseable Program Read Only Memory) and EEPROM (Electrical Eraseable Program Read Only Memory). The advantages of EPROM and EEPROM is readable and written many times, such as data stored on the RAM but will not be lost even if power supply is off like a ROM.
• Tools I / O
Equipment Input / Output is equipment associated with the Unit I / O. Examples of input devices are sensors, limit switches, buttons, selector and more, while examples of output devices are lights, selenoid, buzzer, motor relay, and others.
• Tools Programmers
Programming tools are tools used to insert, edit, modify and monitor existing programs in the PLC memory. This equipment is usually a computer or a Programming Console.
4.2.3.3. The working principle of PLC
A PLC works by continually scanning program. Supposing we could illustrate one scan cycle is to be 3 steps. Typically more than 3 but his outline there are 3 steps, as shown in Figure 6.
Description:
- Check the status of inputs, the first PLC will see the status of each output if its condition is ON or OFF. In other words, whether the sensor is connected to the first input ON? How about that plugged into the second input? So forth, the result is stored into the memory-related and will be used in the next steps;
- Program execution, next the PLC will do or execute your program (ladder diagram) per instruction. Maybe your program says that if the first input status ON the first output will be ON her. Since the PLC has to know which inputs are ON or OFF, and the first step can be determined if indeed the first output should be ON it or not (based on the status of the first input). Then it would save the execution results for use later;
- Update the status of output, the PLC will eventually renew or update the status of the output. Renewal of this output depends on which input is ON during step 1 and the results and the execution of the program in step 2. If the input status ON first, then in step 2, program execution will produce the first output ON, so that in step 3 is the first output will be updated to ON
After step 3, the PLC will repeat its scanning program and iangkah 1, and so on. When a scan is defined as the time needed to work on these 3 steps. Each step can have a response time (response time) are different, the total time response or total response time is the sum of all response time of each step:
input response time + time of execution of the program + output response time
=
total response time
4.2.3.4. Memory allocation at PLC
As the main reference of this module we will discuss the brand PLC from OMRON. but also will be introduced to several others PLC brands that often found in industries such as Siemen and LG as a comparison material. Every brands of PLC have facilities of program instructions and area of internal memory is different. But in principle, work and program instructions and internal memory that exists in every PLC are almost identical, differing only a symbol or code only.
Existing internal memory on the PLC CPU is divided into various functions, such as internal relays, whose function is as a relay within the PLC CPU. Special relay, a relay which has a special function and can not be converted for other purposes.
For example there was a special relay which functions as a clock of 1 second on and 1 sec off, then the special relay can only be used as a contact who always bekeja on and off for 1 second continuously and can not be converted to another. There are many more other functions, which we will discuss one by one based on the reference and each brand of PLC.
a. Memory allocation of Omron PLC
Here is the division of memory allocation on Omron PLC. Because the addressing of each type of PLC memory location is different, in this case depends, and the capacity of each type of PLC. In Table 1. we will see one example and memory allocation on Omron PLC C200H type.
Internal Relay (IR)
Special Relay (SR)
Special Relay is a relay that has a function that has been specified or special, and relays can not be converted for other functions, the following definitions and some examples of some functions of the Special Relay, from word SR253 to word SR255.
Holding Relay (HR)
Holding Relay bits in the status bits will maintain its ON / OFF when the Power Supply OFF. So these bits can be used to switch memory. For example, if you want a system that works accurately, which will not be affected if there are problems with power OFF, meaning that after a power OFF and then ON again, the system will continue operating the last memory. So we must use the facilities HR.
AR
A lot of AR functions such as Flag / Bits for the Inner Board, Flag / Bits for communication, Flag / Bits in case of Error in the PLC, and others. Here is an example of function definition from Word AR 00 and Word AR 01.
Link Relay (LR)
If the PLC is made of two pieces relate to each other, then the LR is used as a means of communication between the PLC.
Data Memory (DM)
Functions as a data storage facility at the PLC, there are memory allocation that can be read / written, and there also can only be read, for example can be seen in Table 1 concerning the allocation of memory on the DM. DM application can be used as a buffer for the process of programming the PLC.
b. Siemen PLC memory allocation
Memory allocation to each PLC Siemens vary depending on the capacity of each of the PLC, in table 4 is the allocation of memory on Siemens S7 PLC.
No different from Omron, Siemens was also have the memory such as Internal Relay, Special Relay, Data Memory and others. At Siemens PLC for the allocation of the address input terminals connected directly to the module using the prefix letter (I), for the allocation of the address output terminals are connected directly to the module using the prefix letter (Q). While for the Internal Relay, addressing use prefix letter (M).
c. The allocation of memory on LG PLC
Here is memory allocation type K-Series.
P: I / O Relay
M: Auxiliary Relay
L: Links ReIay
K: Keep Relay
F: Special Relay
T: Timer
C: Counter
S: Step Controller
D: Data register
# D: Indirectly Specified Registry Data
Constant: Constant
Memory Area "P"
Function as the Input-Output Device, which is connected directly with the Input-Output module. In Table 5 is the explanation of memory "P" as the number of Input-Output PLC, based on type and each PLC:
Memory Area (M)
Memory Area "M" serves as an Internal Relay, which have no specific function, and can be used freely in PLC program, the memory 'M' is not connected to external equipment of PLC directly , either input or output devices. Here is an example of the memory capacity "M" based on each type of PLC CPUs.
Memory area (F)
Memory Area "F" functions as Special Relay can be used as, an indication if an error occurs in the PLC, or can also serve as a Clock. The memory capacity "F" depending on the PLC and CPU type used.
Here are some examples of functions and the memory area "F" or commonly called the Special Relay.
Memory Area (D)
Memory Area "D", serves as Internal Data Register, ie, to store and access data into the PLC. The capacity of the Internal Data register "D" depending on the type of PLC used, see Table 6.
=
total response time
4.2.3.4. Memory allocation at PLC
As the main reference of this module we will discuss the brand PLC from OMRON. but also will be introduced to several others PLC brands that often found in industries such as Siemen and LG as a comparison material. Every brands of PLC have facilities of program instructions and area of internal memory is different. But in principle, work and program instructions and internal memory that exists in every PLC are almost identical, differing only a symbol or code only.
Existing internal memory on the PLC CPU is divided into various functions, such as internal relays, whose function is as a relay within the PLC CPU. Special relay, a relay which has a special function and can not be converted for other purposes.
For example there was a special relay which functions as a clock of 1 second on and 1 sec off, then the special relay can only be used as a contact who always bekeja on and off for 1 second continuously and can not be converted to another. There are many more other functions, which we will discuss one by one based on the reference and each brand of PLC.
a. Memory allocation of Omron PLC
Here is the division of memory allocation on Omron PLC. Because the addressing of each type of PLC memory location is different, in this case depends, and the capacity of each type of PLC. In Table 1. we will see one example and memory allocation on Omron PLC C200H type.
Internal Relay (IR)
- Internal Relay as Input-Output Area
IR which is linked to the terminal allocated Input-Output module. In this allocation, the IR will work ON / OFF, based on the response and input signal-output terminal.
- Internal Relay as WorkArea
Is the IR that do not have a specific function, can be used free in the PLC program, and not connected directly with the Input-Output module. All the IR bit will reset when the CPU power is OFF.
Special Relay (SR)
Special Relay is a relay that has a function that has been specified or special, and relays can not be converted for other functions, the following definitions and some examples of some functions of the Special Relay, from word SR253 to word SR255.
Holding Relay (HR)
Holding Relay bits in the status bits will maintain its ON / OFF when the Power Supply OFF. So these bits can be used to switch memory. For example, if you want a system that works accurately, which will not be affected if there are problems with power OFF, meaning that after a power OFF and then ON again, the system will continue operating the last memory. So we must use the facilities HR.
AR
A lot of AR functions such as Flag / Bits for the Inner Board, Flag / Bits for communication, Flag / Bits in case of Error in the PLC, and others. Here is an example of function definition from Word AR 00 and Word AR 01.
Link Relay (LR)
If the PLC is made of two pieces relate to each other, then the LR is used as a means of communication between the PLC.
Data Memory (DM)
Functions as a data storage facility at the PLC, there are memory allocation that can be read / written, and there also can only be read, for example can be seen in Table 1 concerning the allocation of memory on the DM. DM application can be used as a buffer for the process of programming the PLC.
b. Siemen PLC memory allocation
Memory allocation to each PLC Siemens vary depending on the capacity of each of the PLC, in table 4 is the allocation of memory on Siemens S7 PLC.
No different from Omron, Siemens was also have the memory such as Internal Relay, Special Relay, Data Memory and others. At Siemens PLC for the allocation of the address input terminals connected directly to the module using the prefix letter (I), for the allocation of the address output terminals are connected directly to the module using the prefix letter (Q). While for the Internal Relay, addressing use prefix letter (M).
c. The allocation of memory on LG PLC
Here is memory allocation type K-Series.
P: I / O Relay
M: Auxiliary Relay
L: Links ReIay
K: Keep Relay
F: Special Relay
T: Timer
C: Counter
S: Step Controller
D: Data register
# D: Indirectly Specified Registry Data
Constant: Constant
Memory Area "P"
Function as the Input-Output Device, which is connected directly with the Input-Output module. In Table 5 is the explanation of memory "P" as the number of Input-Output PLC, based on type and each PLC:
Memory Area (M)
Memory Area "M" serves as an Internal Relay, which have no specific function, and can be used freely in PLC program, the memory 'M' is not connected to external equipment of PLC directly , either input or output devices. Here is an example of the memory capacity "M" based on each type of PLC CPUs.
Memory area (F)
Memory Area "F" functions as Special Relay can be used as, an indication if an error occurs in the PLC, or can also serve as a Clock. The memory capacity "F" depending on the PLC and CPU type used.
Here are some examples of functions and the memory area "F" or commonly called the Special Relay.
Memory Area (D)
Memory Area "D", serves as Internal Data Register, ie, to store and access data into the PLC. The capacity of the Internal Data register "D" depending on the type of PLC used, see Table 6.