Search the Community
Showing results for tags 'English'.
Found 152 results
-
MITSUBISHI Automatic Door Operation PLC Programming and Simulation
leigehong posted A plc and hmi english article in PLC programming learning
In this PLC program, automatic door operation is designed using PLC programming to open or close the door when detecting the object. Here the object is nothing but a car. Automatic Door Operation The below simulation shows the automatic door system operation. Inputs and Outputs Type Device No. Device name Operation Input X0 Lower limit ON when door reaches lower limit. Input X1 Upper limit ON when door reaches upper limit. Input X2 In gate sensor ON when object approaches the door. Input X3 Out sensor ON when object leaves the door. Input YO Door up Moves up when YO is ON. Output Y1 Door down Moves down when Y1 is ON. Output Y6 Light Lit when Y6 is ON. Output Y7 Buzzer Sounds when Y7 is ON (Lamp on screen is lit). Program Description As the car approaches the entrance, the door moves up. An In-gate sensor X2 is used to detect the car’s presence at the entrance. The moment the car drives through, the door moves down. An Out-gate sensor X3 is used to detect the car’s presence after crossing the door. The upward movement of the door halts when the upper limit switch (X1) gets activated. Similarly, the door’s downward motion stops when the lower limit switch (X0) gets engaged. The door remains up as long as the car is detected within the range of the entrance (In gate sensor X2) and exit (Out sensor X3). A buzzer (Y7) buzzes as a signal for the door’s movement. While the car is within the detection range, between the In gate sensor (X2) and the Out sensor (X3), a light (Y6) remains illuminated. The status of the door’s movement is indicated by the lighting or extinguishing of four indicator lamps on the control panel. Manual control of the door is possible. Buttons on the control panel can be pressed to either open (⬆Door up) or close (⬇Door down) the door. PLC Programming -
MITSUBISHI Sorting & Distribution Line PLC Programming – Advanced Logic
leikang posted A plc and hmi english article in PLC programming learning
In this advanced PLC logic, detect different part sizes and sort them as per box sizes and place them in the trays. The parts are nothing but different size boxes such as small, medium, and large. The robot places different size boxes randomly on the conveyor. Then the system detects the box size and moves to the respective conveyor and places them in the respective trays. Sorting & Distribution Line PLC Programming The below simulation shows the sorting and distribution line system operation. Inputs and Outputs Type Device No. Device name Operation Input X0 Starting point (Supply) ON when the part is detected. Input X1 Upper ON when the part is detected. Input X2 Middle ON when the part is detected. Input X3 Lower ON when the part is detected at the right end. Input X4 Sensor ON when the part is detected at the right end. Input X5 Sensor The conveyor moves forward when Y1 is ON. Input X6 Detect part ON when the part is detected in front of the pusher. Input X10 arting point (Unload) ON when the unloading robot is at the start point. Input X11 Part on table ON when the part is on the table. Input X12 Robot operation finished ON when the robot operation is finished. Output Y1 Conveyor forward The conveyor moves forward when Y2 is ON. Output Y2 Conveyor forward Moves toward the front when Y3 is ON. Output Y3 rting wing The conveyor moves forward when Y4 is ON. Output Y4 Conveyor forward The conveyor moves forward when Y5 is ON. Output Y5 Conveyor forward Extends when Y6 is ON and retracts when Y6 is OFF. The pusher cannot be stopped in the mid-stroke. Output Y6 Pusher The robot moves part to tray when Y7 is ON. A process cycle begins. Output Y7 Unload command The robot moves the part to tray when Y7 is ON. A process cycle begins. Output Y10 Red Lit when Y10 is ON. Output Y11 Green Lit when Y11 is ON. Output Y12 Yellow Lit when Y12 is ON. Program Description Initiating the push button PB1 (X20) on the control panel triggers the Supply command (Y0), thereby setting the robot in motion for moving the object. Once the robot has completed its task of moving the part and reverting to its original position, the Supply command (Y0) is deactivated. Activating the Supply command (Y0) propels the robot to provide a part. Activating the switch SW1 (X24) on the control panel instigates the conveyors to proceed forward. Conversely, deactivating the switch causes the conveyors to halt. Conveyor-carried parts of varying sizes, namely large, medium, and small, are sorted by input from the Upper (X1), Middle (X2), and Lower (X3) sensors and delivered to designated trays. Large parts are directed to the rear conveyor when the Sorting wing (Y3) on the split conveyor is activated, followed by the part being transported on the conveyor and eventually descending from the right edge. Medium parts are led to the front conveyor when the Sorting wing (Y3) on the split conveyor is deactivated and subsequently transferred to the tray by the robot. Small parts are routed to the rear conveyor upon activation of the Sorting wing (Y3) on the split conveyor. Once the Detect part sensor (X6) in the split conveyor is activated, the conveyor is brought to a halt and the part is nudged onto the tray. When the Robot detects a part on the table (X11), the Unload command (Y7) is activated. Once the robot finishes its operations, indicated by the Robot operation finished (X12) status turning on (which happens when a part is deposited on the tray), the Unload command (Y7) is deactivated. Provided the switch SW2 (X25) on the control panel remains activated, an automatic supply of a new part occurs under the following conditions: When the robot initiates the transportation of a medium part. When a small part is added to the tray, or a large part descends from the right edge of the conveyor. The display lights flash in the following manner: The red light indicates the robot is in the process of supplying a part. Green light signifies the conveyor is in motion. Yellow light is illuminated when the conveyor is at a standstill. PLC Program -
MITSUBISHI PLC Programming: Sorting and Distribution of Boxes by Height
xiangjinjiao posted A plc and hmi english article in PLC programming learning
In this PLC programming, we do sorting and distribution of boxes by height into the designated storage bins using sensors and conveyors. This PLC program distributes the specified number of parts according to their size. PLC Sorting Boxes by Height The below simulation shows the working principle of PLC logic for sorting boxes based on their height. Here we have 3 different size boxes like small, medium, and large sizes. There are three storage bins for each box size. There are three pushers and three conveyors. Each box size has one pusher and one conveyor. The robot places the boxes randomly on the conveyor. The sensors are used to detect the box’s size. The conveyors are started and stopped when the respective box size reaches there using the sensors. The respective pusher is activated and moves the respective box size to the dedicated storage bins. PLC I/O List The below table lists the inputs and outputs of this system. Type Device No. evice Name Operation Input X0 Starting point ON when the robot is at starting point. Input X1 Upper ON when the part is detected. Input X2 Middle ON when the part is detected. Input X3 Lower ON when the part is detected. Input X4 Sensor ON when the part is detected on the incline. Input X5 Sensor ON when the part is detected on the incline. Input X6 Sensor ON when the part is detected on the incline. Input X7 Sensor ON when the part is detected at the right end. Input X10 Detect part ON when the part is detected in front of the pusher. Input X11 Detect part ON when the part is detected in front of the pusher. Input X12 Detect part ON when the part is detected in front of the pusher. Output Y0 Supply command One part is supplied When Y0 is ON. A process cycle begins: Wooden part repeats in order M, S, L, M, M, L, S, S, L, L. Output Y1 Conveyor forward The conveyor moves forward when Y1 is ON. Output Y2 Conveyor forward The conveyor moves forward when Y2 is ON. Output Y3 Conveyor forward The conveyor moves forward when Y3 is ON. Output Y4 Conveyor forward The conveyor moves forward when Y4 is ON. Output Y5 Pusher Extends when Y5 is ON and retracts when Y5 is OFF. The pusher cannot be stopped in the mid-stroke. Output Y6 Pusher Extends when Y6 is ON and retracts when Y6 is OFF. The pusher cannot be stopped in the mid-stroke. Output Y7 Pusher Extends when Y7 is ON and retracts when Y7 is OFF. The pusher cannot be stopped in the mid-stroke. Program Description Programming a Programmable Logic Controller (PLC) for Box Sorting Based on Height and Component Distribution. Initiating the robot’s operation involves pressing the pushbutton PB1 (X20) located on the control panel, which activates the Robot Supply Command (Y0). The Robot Supply Command (Y0) is deactivated upon the robot completing the part movement and returning to its initial position. The Conveyor Movement Command is controlled by the Switch SW1 (X24) on the control panel. Activating the switch (turning it ON) propels the conveyor’s movement forward while deactivating it (turning it OFF) brings the conveyor to a halt. Sorting of parts, segregated into large, medium, and small sizes, is executed through the input from the Upper (X1), Middle (X2), and Lower (X3) sensors. Post-sorting, the parts are conveyed to their designated trays. The presence of a part in the pusher is identified by the activation (turning ON) of the Part Detection Sensors (X10, X11, or X12). Upon part detection, the conveyor is brought to a halt, and the detected part is displaced onto the tray. Note: The operation of the pusher is governed by the Pusher Actuation Command. Upon receiving an ON signal, the pusher fully extends, while an OFF signal causes the pusher to retract. Each tray is to contain a specific number of parts, depending on their size. Any parts exceeding these specified numbers bypass the pusher and are ejected from the conveyor at the right end. The designated number of parts per size is as follows: Large: 3 parts Medium: 2 parts Small: 2 parts PLC Ladder Logic -
MITSUBISHI PLC Based Product Sorting Machine System – Lift Control
leikang posted A plc and hmi english article in PLC programming learning
In this advanced PLC program, PLC based product sorting machine system is used to carry different products using the lift to separate the parts based on size. Here there are three positions available based on the size like small, medium, and large. The conveyors are used to transfer the products and place them on the trays. PLC Based Product Sorting Machine System The below simulation shows the PLC sorting system using the lift operation. Inputs and Outputs Type Device No. Device name Operation Input X0 Upper ON when part is detected. Input X1 Middle ON when the lift is at a lower position. Input X2 Lower ON when the part is detected. Input X3 Part on lift ON when the part is detected. Input X4 Lower lift position ON when the lift is at the middle position. Input X5 Middle lift position ON when the lift is at middle position. Input X6 Upper lift position ON when the part is on the lift. Input X10 Sensor ON when the part is detected at the left end. Input X11 Sensor ON when the part is detected at the left end. Input X12 Sensor ON when the part is detected at the right end. Input X13 Sensor ON when the part is detected at the left end. Input X14 Sensor ON when the part is detected at the right end. Input X15 Sensor ON when the lift is at the upper position. Output YO Supply command One part is supplied when YO is ON: Metal cylinder repeats in order S, L, M, L, M, S. Output Y1 Conveyor forward ON when the part is detected at the right end. Output Y2 Lift up command The lift moves up when Y2 is ON. The lift stops when Y2 is OFF. Output Y3 Lift down command The lift moves down when Y3 is ON. The lift stops when Y3 is OFF. Output Y4 Lift rotation command The conveyor moves forward when Y1 is ON. Output Y5 Lower conveyor forward Lift rotates to transfer part to conveyor when Y4 is ON. Lifts rotates back to the original position when Y4 is OFF. Output Y6 Middle conveyor forward The conveyor moves forward when Y5 is ON. Output Y7 Upper conveyor forward The conveyor moves forward when Y6 is ON. Program Description The entire system comprises two components: General Control and Lifter Management. General Control: Activating the PB1 (X20) button on the operational panel initiates the Supply command (Y0) for the hopper. Deactivating the PB1 (X20) button turns the Supply command (Y0) off. Upon activation of the Supply command (Y0), the hopper delivers a part. The conveyors initiate movement when the SW1 (X24) on the control panel is activated. Conversely, the conveyors halt movement when the SW1 (X24) is deactivated. Upon detecting a part by the sensor X10, X12, or X14 positioned to the left of the conveyor, the corresponding conveyor initiates, transporting the part to the right-end tray. Three seconds post a part passing by the sensor X11, X13, or X15 to the right of the conveyor, the conveyor halts. Parts of varying sizes (large, medium, small) on the conveyor are sorted by the inputs of the Upper (X0), Middle (X1), and Lower (X2) sensors. Lifter Management: Once the Part on the lift sensor (X3) in the lift is activated, the part is transported to one of the following conveyors based on its size: Large part: Directed to the Upper conveyor Medium part: Directed to the Medium conveyor Small part: Directed to the Lower conveyor The commands for Lifting Up (Y2) and Lifting Down (Y3) are managed based on the lift’s position, detected by the following sensors: Upper: X6 Middle: X5 Lower: X4 Upon the part’s transfer from the lift to the conveyor, the Lifter Rotation command (Y4) is initiated. Post the transfer of a part, the lift returns to its initial position and remains on standby. PLC Logic -
MITSUBISHI PLC Program for Stage Control: Curtains and Stage Elevation
leigehong posted A plc and hmi english article in PLC programming learning
The PLC program for stage control provides the opening and closing of curtains, as well as the raising and lowering of the stage. It provides two modes of operation: automatic and manual. PLC Program for Stage Control The below simulation shows the usage of PLC for stage-controlling applications. This is a utility project where we have to open and close the stage curtains automatically and also manually using push buttons. The sensors are used to detect the right and left curtains’ positions at different points. After opening the curtains, the stage will be moved up and elevated to the top position. Similarly, when the curtains are closed, the center stage will be moved down. The stage position will also be tracked using lower and upper limit sensors. PLC Devices List The below table lists the all inputs and outputs in this PLC program. Type Device No. Device name Operation Input X0 Inside (Left curtain) ON when the curtain is halfway. Input X1 ON when the curtain closes completely. ON when the curtain opens completely. Input X2 Outside (Left curtain) ON when the curtain closes completely. Input X3 Inside (Right curtain) ON when the curtain is on its half-way. Input X4 Middle (Right curtain) ON when the curtain opens completely. Input X5 Outside (Right curtain) ON when the stage reaches a lower limit. Input X6 Stage upper limit The stage moves up when Y2 is ON. The stage stops when Y2 is OFF. Input X7 Stage lower limit ON when the stage reaches the upper limit. Output Y0 Curtain open command Curtains open when Y0 is ON. Curtains stop when Y0 is OFF. Output Y1 Curtain close command Curtains close when Y1 is ON. Curtains stop when Y1 is OFF. Output Y2 Stage up The stage moves up when Y2 is ON. The stage stops when Y2 is OFF. Output Y3 Stage down The stage moves down when Y3 is ON. The stage stops when Y3 is OFF. Output Y5 Buzzer Sounds when Y5 is ON (Lamp on screen is lit). Program Description PLC program to Control stage settings including opening/closing curtains and raising/lowering the stage. The purpose of this PLC program is to facilitate control over a range of stage settings, encompassing tasks such as opening and closing curtains, as well as raising and lowering the stage itself. To accommodate different preferences and requirements, the program offers two distinct modes of operation: automatic and manual. Automatic Operation When the “Begin” pushbutton (X16) on the operation panel is pressed, a buzzer (Y5) emits a sound for a duration of 5 seconds. Note: The “Begin” pushbutton (X16) can only be activated when the curtains are closed and the stage is positioned at its lower limit. After the buzzer stops, the command to open the curtains (Y0) is activated. The curtains will continue opening until they reach their outer limits, as defined by input signals X2 and X5. Once the curtains are fully opened, the stage begins to elevate when the “Stage up” command (Y2) is activated. The stage will continue moving upward until it reaches its upper limit, as indicated by input signal X6. Pressing the “End” pushbutton (X17) on the operation panel initiates the closing of the curtains. The command to close the curtains (Y1) is activated, and the curtains will close until they reach their inner limits, defined by input signals X0 and X3. Manual Operation The following operations are only available when the automatic operation described above is not active. The curtains can be opened by pressing the “Curtain open” pushbutton (X10) on the operation panel. The curtains will stop once they reach their outer limits (X2 and X5). The curtains can be closed by pressing the “Curtain close” pushbutton (X11) on the operation panel. The curtains will continue closing until they reach their inner limits (X0 and X3). The stage can be raised by pressing the “⬆Stage up” pushbutton (X12) on the operation panel. The stage will stop once it reaches its upper limit (X6). The stage can be lowered by pressing the “⬇Stage down” pushbutton (X13) on the operation panel. The stage will stop once it reaches its lower limit (X7). The indicator lamps on the operation panel will illuminate or turn off accordingly, providing visual feedback on the status of the curtains and stage operations. PLC Programming -
MITSUBISHI Advanced PLC Conveyor Control: Forward and Reverse Rotation
leizuofa posted A plc and hmi english article in PLC programming learning
PLC Programming for Controlling Conveyor Direction: Facilitating Forward or Reverse Movement Based on Detected Part Size. Identify Each Part’s Size and Ensure its Distribution to the Designated Location. Advanced PLC Conveyor Control The hopper provides different size objects when the operator presses the pushbutton then the conveyors and sensors are used to separate the objects based on their size. A pusher is used to separate two different object sizes. The conveyor can move forward and in reverse directions to place the objects as per their dedicated storage trays. A robot is used to pick and place the objects in medium size boxes. The below simulation shows the PLC conveyor simulation with different box sizes. PLC Inputs and Outputs The below table lists the inputs and outputs of this PLC project. Type Device No. Device name Operation Input X0 Upper ON when the part is detected. Input X1 Middle ON when the part is detected. Input X2 Lower ON when the robot is at starting point. Input X3 Detect part ON when the part is detected in front of the pusher. Input X4 Starting point The conveyor moves forward when Y1 is ON. Input X5 Part on table ON when the part is on the table. Input X6 Robot operation finished ON when the part is detected on the incline. Input X7 Sensor ON when the part is detected at the right end. Input X10 Sensor ON when the part is detected at the left end. Input X11 Sensor ON when the part is detected at the right end. Input X12 Sensor ON when the robot operation is finished. Output Y0 Supply command One part is supplied when Y0 is ON: Wooden part repeats in order L, M, S, M, S, L. Output Y1 Conveyor forward The conveyor moves forward when Y2 is ON. Output Y2 Conveyor forward Extends when Y3 is ON and retracts when Y3 is OFF. The pusher cannot be stopped in the mid-stroke. Output Y3 Pusher The robot moves part to tray when Y4 is ON. A process cycle begins. Output Y4 Unload command The conveyor moves forward when Y5 is ON. Output Y5 Conveyor forward The conveyor moves backward when Y6 is ON. Output Y6 Conveyor reverse Conveyor moves backward when Y6 is ON. Program Description When the pushbutton PB1 (X20) on the control panel is pressed, it activates the Supply command (Y0) for the hopper. Once you release pushbutton PB1, the Supply command is deactivated. Whenever the Supply command is engaged, the robot dispenses a part. When the switch SW1 (X24) on the control panel is activated, the conveyors start moving forward. As soon as you deactivate SW1, the conveyors halt. The conveyors transport large, medium, and small parts, which are sorted by the Upper (X0), Middle (X1), and Lower (X2) sensors respectively, to designated trays. Large part: Directed to the lower conveyor and delivered to the tray on the right. Medium part: Transferred to the tray by the robot. Small part: Directed to the lower conveyor and delivered to the tray on the left. When the Detect part sensor (X3) is activated, the conveyor stops, and a large or small part is directed to the lower conveyor. Note: When the actuating command for the pusher is turned ON, it fully extends. When the actuating command is turned OFF, the pusher fully retracts. When the Part on the table (X5) sensor in the robot is activated, the Unload command (Y4) is engaged. When the Robot operation is finished (X6) sensor is activated (it activates when a part is placed on the tray), and the Unload command (Y4) is deactivated. As long as the switch SW2 (X25) on the control panel is ON, a new part is automatically supplied in the following scenarios: When the robot starts to handle a medium part When a small or large part is deposited into a tray PLC Programming Conveyor Forward and Reverse Rotation Control -
SIEMENS Transferring Data Across PLC Systems – TSEND_C and TRCV_C
leikang posted A plc and hmi english article in PLC programming learning
In the last articles, we discussed how to establish a connection between two PLCs using the TCON and TDISCON blocks and how to move data between them using the TSEND and TRCV blocks. Transferring Data Across PLC Systems In this article, we will learn a new instruction that can be used to communicate and transferring data across PLC systems using TSEND_C and TRCV_C blocks. TSEND_C The TSEND_C instruction is a TIA Portal instruction that is used to set up and establish a connection between two PLCs. Once the connection has been set up and established, it will be automatically maintained and monitored by the PLC. The TSEND_C instruction is executed asynchronously and has the following functions: Setting up and establishing a communication connection similar to TCON block. Sending data via an existing communication connection similar to TSEND block. Terminating or resetting the communication connection similar to TDISCON. Hence, the name compact is giving to the TSEND_C as it acts as more than 3 blocks in the same time. TRCV_C The TRCV_C instruction is also a TIA Portal instruction that is used to set up and establish a connection between two PLCs. Once the connection has been set up and established, it will be automatically maintained and monitored by the PLC. The “TRCV_C” instruction is executed asynchronously and implements the following functions in sequence: Setting up and establishing a communication connection similar to TCON. Receiving data via an existing communication connection similar to TRCV. Terminating or resetting the communication connection similar to TDISCON. Hence, the name compact is given to the TRCV_C as it acts as more than 3 blocks at the same time. Using TSEND_C and TRCV_C in our PLC project In the last article, when we needed to establish and move to send data from PLC_1 into PLC_2 we had to use three different blocks in each PLC. See picture 1. picture 1. Logic inside PLC_1 As you can see, we used the TCON and TDISCON blocks to establish and reset the connection and we used TSEND to send the data from PLC_1. And the same was done for the PLC_2. See picture 2. picture 2. Logic of PLC_2 Again, we used the TCON and TDISCON blocks to establish and reset the connection and we used TRCV to receive the data from PLC_1. Now, we want to replace all these blocks and try to use the TSEND_C and TRCV_C instead to achieve the same functionality. First, in PLC_1 where we need to send data, we will use the TSEND_C block, just drag and drop the block inside the main OB1. See picture 3. picture 3. Add TSEND_C block. As the TSEND_C is essentially a function block, you will be asked to create a data instance. See picture 4. picture 4. Create an instance for the TSEND_C The TSEND_C looks similar to the TSEND block in the sense that you need to make some configurations and add some signals. See picture 5. picture 5. TSEND_C block Now, we need a signal for the REQ and Data to send and also to configure the connection. For the REQ signal, we created a SendData tag. Also, we can just drag and drop the data block that we created last article which we need to send it to PLC_2, we can just drag it and drop at the DATA input of the block. See picture 6. picture 6. Configuration of TSEND_C block. To configure the connection parameter for the block, we can press the small configuration icon on top of the block to open the configuration view. The configuration view will look something very similar to that of the TCON block. See picture 7. picture 7. Connection parameter of TSEND_C We already showed how to configure the connection parameter in previous articles, so we can just do the same as we did with the TCON block, see picture 8. picture 8. Configuration of connection parameter With this connection configuration, we finished all configurations of the TSEND_C. Notice how much faster it was compared to configuring TCON, TDISCON, and TSEND blocks. Now, we need to add the TRCV_C to the PLC_2 so it can receive the data sent from PLC_1. In the main OB1 of PLC_1 just drag and drop the TRCV_C into your logic. see picture 9. Remember to create a data instance for the TRCV_C block. picture 9. Add the TRCV_C Once the TRCV_C is added to your logic, we need to configure it. As we did with the TSEND_C we need to add a signal to enable the data receive and also we need to add the data block we will save the data inside. See picture 10. picture 10.TRCV_C We defined a RecieveData tag as the EN_R signal. See picture 11. picture 11. Define EN_R tag Remember to uncheck the “optimized block access” option of the data block or the block won’t work as we showed last articles. Next, we need to configure the connection parameters of the TRCV_C block, as we did with the TSEND_C just keep in mind that the unspecified Partner PLC is now the PLC_1 see picture 12. picture 12. Connection parameter of TRCV_C PLC Project Simulation Now that we have configured the TSEND_C and TRCV_ C block, we want to simulate our project and see how they will work but first, we will create a simple logic to automatically update the data of PLC_1 which will be sent to PLC_2. See picture 13. picture 13. Simple logic to update data automatically. Now let’s compile and start a simulation for our project. The first thing you will notice is that PLC_1 and PLC_2 will try to establish a connection right away because we set up the TSEND_C and TRCV_C they automatically try to establish a connection. That is why there will be a connection between the two PLCs. See picture 14. Picture 14. Connection is established directly. As you can see the connection between the PLCs is directly established, because the CONT parameter in the TSEND_C and TRCV_C is set to TRUE, which means the block will automatically try to establish a connection with the partner PLC. We can put any controlling signal in here to control the connection establishment. The other thing you can see is that the REQ of the TSEND_C and the EN_R of the TRCV_C are set to FALSE, and that is why there will not be any data moving between the PLCs. See picture 15. picture 15. No data transfer between PLCs. If the REQ signal of the TSEND_C is set to true, the PLC_1 will try to send the data but it will wait for the other PLC to enable the data to be received, see picture 16. picture 16. REQ is true. As you can see the SendData is TRUE, but no data was sent because the RecieveData is still false. The PLC_2 will only receive data from PLC_1 only when the ReceiveData is set to true. See picture 17. picture 17. Data is sent to PLC_2 As you can see when the RecieveData is true. Data will be sent from PLC_1 into PLC_2, However, you can see that the data inside the two PLCs are different because the data of PLC_1 changes automatically as per the simple logic we made before. That means the EN_R signal allows the transfer of data one time, when I need to transfer data again this signal has to become false and then true again. Check out the attached TIA Portal project and see the data transfer between PLCs. -
Heating and Mixing of Products using PLC Example Tutorial
caixiaofeng posted A plc and hmi english article in PLC programming learning
This is a PLC Program for automatic heating and mixing of products. Learn the PLC programming with this example for engineering students. Heating and Mixing of Products Problem Description Make an automatic system in which two materials are collected in one tank. All materials are to be mixed till they achieve a predefined set point of temperature. Make a ladder program in S7-1200 PLC for this application. Problem Diagram Problem Solution We can solve this problem by using simple logic. For this system consider two separate level switches to detect the level of two different materials (Lets say Material A & Material B). Also consider one level switch for empty level detection. For controlling the level we can use single acting valve (fully open and fully close type). For mixing, agitator is used and it is connected with motor shaft. Heater and temperature sensor are installed inside the tank. Here materials are mixed until it reaches the set point of temperature and after mixing, outlet valve (Q0.4) will be operated to drain the mixed products. List of Inputs & Outputs Inputs List Cycle START :- I0.0 Cycle STOP :- I0.1 Level of material B :- I0.2 Level of material A :- I0.3 Empty level switch :- I0.4 Temperature sensor :- I0.5 Outputs List Inlet valve 1 :- Q0.0 Inlet valve 2 :- Q0.1 Agitator motor :- Q0.2 Heater :- Q0.3 Outlet valve :- Q0.4 M Memory M0.0 :- Cycle ON PLC Program for heating and mixing of product Program Explained In this problem, we will consider S7-1200 PLC and TIA portal software for programming. Network 1: This network shows simple latching circuit for cycle ON and cycle OFF. Normally Open (NO) contact of cycle START button (I0.0) and NC contact of cycle STOP button (I0.1) for cycle activation. Network 2: This network is to operate Inlet Valve 1(Q0.0). It is operated when Low Level of the tank is detected (I0.4). And it is closed when Level Material A is detected by a switch with address (I0.3). START PB (I0.0) also connected in parallel so if low level not detected, inlet valve can be started by pressing START PB (I0.0). Network 3: This network is to operate inlet valve 2 (Q0.2).It is operated when material A is filled with its desired level. When cycle is running and level of material A is detected, inlet valve 2 (Q0.1) will be ON. Network 4: This network is to operate agitator motor and heater. When tank is full with material A and material B, heater (Q0.3) and agitator motor (Q0.2) will be ON. Network 5: When entire mixing process and heating are completed, outlet valve (Q0.4) will be ON. NC contact of empty level switch (I0.4) is used to stop the outlet valve when tank is empty. Note :- Above logic is for explanation of certain application only. The diagram is for representation purpose, actual system might be different form this system. Result -
PLC logic program controls water level
leigehong posted A plc and hmi english article in PLC programming learning
Design a PLC program to control the level of a water storage tank by turning a discharge pump ON and OFF based on Low and High levels. PLC Program for Water Level Control Logic Description Auto : if Auto Mode selected in Local Control Panel, then pump will be logically controlled based on Low Level Switch and High Level Switch Manual : if Manual Mode Selected in Local Control Panel, then irrespective of Low Level Switch & High Level Switch Status, Pump will be controlled manually using ON/OFF button in Local Control Panel. When the water level reaches low level then pump will be stopped. if the level of the water reaches high point, the pump will started so that the water can be drained and thus lowering the level. Indication Panel : This panel contains LED’s to show the status of the water level control. It has Pump Running, Low Level & High Level Signals If pump is running then the Pump Running status lamp will be ON. then, if Low Level Switch activated then Low Level Status lamp will be ON. if High Level Switch activated then High Level Status lamp will be ON. PLC Ladder Logic Manual Mode Selected, OFF Position and Water at Low Level Manual Mode Selected & Water between Low & High Levels Auto Mode Selected & High-Level Switch Activated -
SIEMENS Siemens S7-1200 PLC Hardware Configuration
caixiaofeng posted A plc and hmi english article in PLC programming learning
S7-1200 PLC is a compact, modular, and cost-effective solution that offers a wide range of features and flexibility for small to mid-sized automation applications. These features include communication options, memory, CPU performance, and IOs configuration. When you have a process that you need to control, you should choose the PLC and configure it to best fit your process requirements. In this article, we will discuss the hardware configuration of S7-1200 PLC and we will give an example of how to configure it in the Siemens Tia portal. Contents: What is the hardware configuration of a PLC? Importance of hardware configuration. Simple project example. How to configure our PLC with the given example? Hardware configuration of CPU. IOs hardware configuration. HMI configuration. Conclusion. What is the hardware configuration of a PLC? The hardware configuration refers to the specific components of the PLC, such as the CPU, memory, input/output (I/O) modules, communication ports, power supply, and any additional modules or accessories that may be needed and added to the system. The hardware configuration of a PLC also includes enabling or disabling some of the CPU features, depending on the device, its capabilities, and the requirements of your process. The hardware configuration steps for a PLC typically involve the following: Select the appropriate PLC model based on the application requirements. Identify the input/output requirements for the system, which include the type and number of sensors, actuators, and other devices that will be connected to the PLC. Choose the communication protocol and network topology that will be used to connect the PLC to other devices and systems. Determine the power supply requirements for the PLC and its peripherals. Mount the PLC in an appropriate location and connect all the necessary cables and wires. Configure the PLC software to communicate with the hardware components and set up the appropriate logic and control functions. The specific steps for hardware configuration may vary depending on the PLC model and the application requirements, but these are the basic steps that are typically involved in the process. In this article, we will talk about the hardware configuration that is done in the TIA Portal platform. That means we will assume that you know your application and that you have already chosen your PLC model and the Power supply to feed it. You can refer back to previous articles where we discuss how to choose the PLC and power supply that best fits your application. Importance of Hardware Configuration in PLC Proper hardware configuration ensures the system is reliable and robust. If the hardware components are not configured correctly, they may not work as intended, resulting in system failures or errors Hardware configuration affects the performance of the system. By choosing the right hardware components and configuring them appropriately, the system can operate at maximum efficiency and speed and can handle a high volume of inputs and outputs. Hardware configuration impacts the scalability and flexibility of the system. The choice of hardware components and their configuration should take into consideration future expansion or modifications to the system, to ensure that the system can easily accommodate changes or upgrades. Hardware configuration affects the cost of the system. By selecting the appropriate hardware components and configuration, unnecessary costs can be avoided, and the overall cost of the system can be minimized. S7-1200 Hardware Configuration We will assume a simple PLC project and see how we can configure the PLC into our project before we start writing our code. Temperature Control System for a Reactor using PLC The project involves controlling the temperature of a reactor using a PLC. The system should measure the temperature of the reactor and adjust the temperature by controlling the flow of a cooling fluid. The project uses four thermocouples to measure the temperature, two solenoid valves to control the flow of the cooling fluid, and a motor to drive the impeller of the reactor. I/O Configuration Inputs: Thermocouples 1 – 4: these are 4 analog inputs that measure the temperature at different locations inside the reactor. Emergency Stop Pushbutton: This is a digital input that is used to stop the system in case of an emergency. Temperature Set Point Potentiometer: This is an analog input that allows the operator to set the desired temperature setpoint. Outputs: Solenoid Valve 1 and 2: these are 2 digital outputs that control the flow of the cooling fluid through the reactor pipes. Motor Control: This is a digital output that controls the speed and direction of the motor that drives the impeller. Heater Control: This is a digital output that controls the heating system of the reactor. System Operation: The system waits for the operator to set the temperature setpoint using the potentiometer. The PLC reads the temperature setpoint and compares it to the current temperature of the reactor, which is measured by the four thermocouples. If the reactor temperature is below the setpoint, the PLC activates the heater control output to increase the temperature. If the reactor temperature is above the setpoint, the PLC activates one of the solenoid valve outputs to increase the flow of the cooling fluid and decrease the temperature. The PLC continuously monitors the temperature and adjusts the heater and cooling systems to maintain the desired setpoint. The PLC also controls the motor that drives the impeller to mix the contents of the reactor. If the emergency stop pushbutton is pressed, the PLC deactivates all the outputs and stops the system. The PLC project can be further expanded and modified to include additional functionality, such as alarms, data logging, or remote monitoring, depending on the specific requirements of the project. However, we will not care about coding the PLC logic of this system, rather we will use this example to explain how to hardware configure the PLC to fit our project. This includes: Selecting the PLC CPU. Selecting the IO modules. Assigning the input and output tags to the hardware modules. Assigning an IP to the PLC for communication. Assigning a protection password. Configuring the local time of the PLC. Configuration the HMI and set the connection with PLC. How to configure PLC with the given example? Below we will discuss the basic PLC project creation with the required hardware. The hardware configuration of the CPU: Selecting the CPU: When you start a new project in TIA Portal, you should configure a new device and add it to your project. See picture 1. Picture 1. Configure a device for your project As you can see from the previous picture, the TIA portal already shows you that the first step should be configuring a new device. In the previous article, we discussed how to choose the PLC that fits your process, so we will not mention that here again, for our project as it is a simple project we will choose the CPU 1214C AC/DC/RLY. See picture 2. Picture 2. Add a new controller to the project CPU Properties: Depending on the CPU that you have selected for your project, different CPU features and properties will be available. You can enable or disable these features depending on your needs. Some of the features will need extra configuration to be made. See picture 3. Picture 3 – Properties of CPU As you can see in the previous picture there are many properties that you can set for your CPU in the project. We will mention some of these properties which you will need to configure in each project you make, some other properties are used only in special cases. Communication: This is a very important configuration for any PLC project; your project will most probably have different modules and devices that need to talk to each other. Setting up the communication between your PLC and these devices is important for your project. By selecting the CPU you already have defined how the communication will be. Some CPU only works with Profinet, some only work with Profibus and some have the ability to use both. The selected PLC for this example only works with Profinet. From the Profinet interface you will set the IP address for your PLC, this IP should be unique in the project; you can’t use the same IP for two different modules. See picture 4. Picture 4 – Profinet interface Cycle time: This is another important property for your PLC, as you know; the cycle time of your program will depend on how much code you have written and how long it will take the PLC to execute this code. In the cycle time properties, you can set the cycle monitoring time, if the PLC takes longer than this set time to execute the program, then the PLC will give an error. See picture 5. From this property you can also determine the minimum cycle time for your CPU, you can do that if you triggered the “Enable minimum cycle time for cyclic OBs”. You then can write the minimum cycle time that you want, and the PLC will adjust its performance to match this time. Off course this time is limited by the CPU performance capability, so you can’t lower this time below a certain limit. Picture 5 – Cycle time Property System and clock memory bits: System memory bits and clock memory bits are built-in bits inside the CPU that the operating system used to indicate certain events in the PLC. For example, there is a memory bit that will change to TRUE only at first scan or a memory bit that will be TRUE if diagnostic status changes, there are also some dedicated clock memory bits like a bit representing a clock of 10Hz or a bit representing a clock of 2Hz. These bits can be very useful in some applications and can save a lot of programming code to obtain the same functionality. See picture 6. picture 6 – Enable system and clock memory bits You can enable the use of one or both memory bytes; you can also determine the address of these bytes as you can see from the picture. Time of Day: Another very important property of your PLC is setting the time inside your PLC. In almost any project you make, you will need to know the real-time to be able to assign certain actions with different dates. In the previous article, we talked about local and system times inside the PLC and how to use them. This property of the CPU allows you to set the local time to the time zone that you want. See picture 7. Picture 7 – Local time property Protection and security: From this property, you can determine the access level and password protection for your PLC. See picture 8. Picture 8 – Protection and security property The previously mentioned properties are the most commonly configured properties with almost any PLC project you would do. There are some other properties that are less likely to be used with simple programs such as Web servers and OPC UA. The next step in the Hardware configuration of your project is configuring the IOs. IOs hardware configuration: Another important step of your project is the configuration of your IOs, which means deciding how many IO modules you need and what kind of IO modules you need. When deciding about your IOs, you should consider some key points like having some spare IO points and choosing the IO modules that fit the input sensors and output actuators inside your project. See picture 9. Picture 9 – Adding analog input module As we mentioned in our example project, we have 4 thermocouples used as analog inputs to my PLC, so I need to add an analog input module with at least 4 input channels because the selected PLC only has 2 analog input channels. Another thing is that the thermocouple is a special type of analog input that requires a dedicated input module. That is why we chose the AI 8xTC module, which has 8 input channels dedicated to being used with thermocouples; we choose the 8-channel module and the 4 to have spare channels for future use in case we need to expand our project. If you go to the properties of the AI 8xTC module you will see that you can configure each input channel individually, you can choose the type of thermocouple, scale of measurement, and other properties. See picture 10. Picture 10 – Configuring input module Next, you will need to define your IOs tags and assign each input or output you have to a proper IO point in your PLC or in the IO modules. See picture 11. Picture 11 – Assign input tags Then you continue to assign the rest of the inputs and outputs tags, see pictures 12 and 13. Picture 12 – Assign input tags for the PLC Picture 13 – Assign output tags to your project HMI Configuration Your PLC project will probably need an HMI, after selecting your HMI there are different configurations you can make. In this article, we will only show how to configure the communication between the HMI and the PLC. As you see from the previous picture, you select an HMI by adding a new device and then select an HMI. See picture 14. Picture 14 – Selecting an HMI There are different ways to set the communication between the HMI and the PLC, but the easiest way is through the network view page. See picture 15. Picture 15 – Setting HMI connection Inside the network view page, you can set the connection between the HMI and the PLC by simply clicking on the small green square representing Profinet from the HMI and dragging it to the PLC. TIA Portal will then draw a green line between the two modules and it will automatically give the HMI an IP address to set the communication between them. Conclusion Hardware configuration is a very critical step of any PLC project. The proper hardware configuration of your PLC will ensure that the needed functionalities of the project are met. Hardware configurations include selecting IO modules, enabling or disabling certain CPU properties, and configuring different devices like HMI with your PLC. -
PLC Program for Automatic Bottle Rejection System
xiangjinjiao posted A plc and hmi english article in PLC programming learning
This is the PLC program for the automatic bottle rejection system. Learn the ladder logic with this PLC exercise and solution. Automatic Bottle Rejection Problem Description Nowadays Automation in industries is necessary for Accurate and fast Production. Let’s Take an Example of soda bottle companies, where the belt conveyor is used for transferring the bottles from one station to another station. But before bottles reach at soda filling station it is necessary to make all bottles are in standing position for further processing A fallen bottle on the conveyor may create a problem in the next process. so here we discuss a simple PLC Logic that handles the fallen bottle. PLC Problem Diagram PLC Problem Solution So for that we use PLC system at filling station, which reject the fallen bottle from the conveyor & clear the path for the next process. This process is made by using sensors & actuators. We use pneumatic piston cylinder assembly for pushing the fallen bottles from the conveyor. When conveyor is running, then all bottles transfer form one station to other station for next process. There are two sensors are used, for standing and fallen bottles detection, one pneumatic cylinder for pushing the fallen bottle from the conveyor. List of Inputs/Outputs Inputs List Start PB : I0.1 Stop PB : I0.0 Sensor X1 : I0.2 Sensor X2 : I0.3 Outputs List Cycle ON : Q0.0 Conveyor : Q0.1 Cylinder : Q0.2 PLC Program for Automatic Bottle Rejection System PLC Program Explanation In this application, we have used Siemens S7-1200 PLC and TIA Portal Software for programming. We can also design this logic with relay circuit also. Network 1: In Network 1, we have taken cycle ON condition for machine. Here we have taken START PB (I0.1) for starting the cycle and STOP PB (I0.1) for cycle STOP. We have taken parallel output of conveyor (Q.1) with cycle ON (Q0.0) so we can operate conveyor with cycle ON condition. Network 2: In Network 2, we have taken sensors X1(I0.2) and X2(I0.3) as inputs. We used NO contact for X2 (I0.3) sensor and NC contact for X1 (I0.2) sensor. When Bottles are transferring on the conveyor, these sensors sense the position of the bottles whether they are standing or fallen. Sensor X2(I0.3) sense down position of the Bottle & Sensor X1(I0.2) Sense top position of the bottle. In PLC, we designed the circuit which follows command that if sensor X2(I0.3) sense the bottle & sensor X1(I0.2) does not sense the bottle then the pneumatic actuator (Q0.2) will come in action & it will reject the bottle from the conveyor. After this, the perfect bottles will go in the soda filling station & whole cycle will be completed. Result Note: The above PLC Logic provided for basic idea about application of PLC in Automatic Bottle Rejection Handling System. The Logic is limited and not complete application. -
PLC program for alarm indication during control
xiangjinjiao posted A plc and hmi english article in PLC programming learning
Create a PLC program for alarm indication in the process control industry. Learn the PLC programming with this industrial example. Alarm Indication in Process Control In many industries there are lots of machines which are performing many tasks automatically. There are many sensors and components used in system or process. Sometimes operator may not be identify the problems of machine or system by visual observations. And also sometimes there will be a chance that machine stops working due to some problem in it. Problem Diagram PLC Solution We can solve this problem by adding alarms in system or process. Alarms are added to alert operator to monitor that machine/process about to cross its limit values or already crossed the limit. Alarms are indicated to the operator by annunciator or horns, and lights of different colors on the panel. (For example, green lights meant OK, Yellow meant not OK, and Red meant BAD.) The purpose of alarms is to use automation to help human operators as they monitor and control processes, and alert them regarding abnormal situations of the plant. Incoming/Input process signals are continuously monitored, and if the value of a given signal moves into an abnormal condition, a visual and/or audio alarm informs the operator regarding the situation. We can configure alarms for system by different ways, such as MIMIC, indication lamps on panel board, SCADA, HMI etc. For our problem discussions, we considered one simple system and configure alarms for the system. For example consider one filling and discharging process and in this system we want to consider some alarms, we will show alarm by using lamps on panel board. For example, consider following alarms for our system, Emergency stop pressed Feed valve open error Feed valve close error Discharge valve open error Discharge valve close error Here all are errors, so we take all red color indication as shown in above figure. List of Inputs & Outputs in PLC Inputs List Cycle START : I0.0 Cycle STOP : I0.1 Low Level Switch, LL : I0.2 High Level Switch, LH : I0.3 Feed VLV open LS : I0.4 Feed VLV close LS : I0.5 Disc. VLV open LS : I0.6 Disc. VLV close LS : I0.7 Emergency STOP : I1.0 RESET : I1.1 Output List Cycle ON : Q0.0 Feed valve : Q0.1 Disc valve : Q0.2 BUZZER : Q0.3 Emergency STOP pressed : Q0.4 (Indication lamp) Feed VLV open error : Q0.5 (Indication lamp) Feed VLV close error : Q0.6 (Indication lamp) Disc VLV open error : Q0.7 (Indication lamp) Disc VLV close error : Q1.0 (Indication lamp) PLC Program for Alarm indication in Process Control Logic Explained In this application, we have used Siemens S7-300 PLC and TIA Portal Software for programming. Network 1: In network 1, we used latching circuit for cycle ON (Q0.0) output. It can be started by pressing cycle START PB (I0.0) and STOP by pressing STOP PB (I0.1). When cycle will be START then system checks level of the tank. If tank level is low then the feeding process will start and if tank level reaches high then Discharge cycle will START. Network 2: When tank reaches low level then LL (I0.2) will be activated and feeding cycle will be ON. Here we have taken NC contact of LH (I0.3) so when PLC will detect high level then it will STOP feeding cycle. Network 3: When tank reaches high level then LH (I0.3) will be activated and discharging cycle will be ON. Here we have taken NC contact of LL (I0.2) so when PLC will detect low level then it will STOP discharge cycle. Network 4: When system receives Emergency STOP (I1.0) input then it will activate the Emergency STOP pressed output (Q0.4) and alarm indication will be provided to the operator. Network 5: In this network we have configured feed VLV open error alarm (Q0.5), when feed valve is ON and Feed VLV open LS (I0.4) is not detected then timer will START and after 5s Feed VLV open error alarm is ON (Q0.5). Network 6: In this network we have configured feed VLV CLOSE error alarm (Q0.6), when feed valve is CLOSE and Feed VLV CLOSE LS (I0.5) is not detected then timer will START and after 5s Feed VLV CLOSE error alarm is ON (Q0.6). Network 7: In this network we have configured Disc VLV OPEN error alarm (Q0.7), when disc valve is ON and disc VLV OPEN LS (I0.6) is not detected then timer will START and after 5s disc VLV OPEN error alarm is ON (Q0.7). Network 8: In this network we have configured Disc VLV CLOSE error alarm (Q1.0), when disc valve is CLOSE and disc VLV CLOSE LS (I0.7) is not detected then timer will start and after 5s disc VLV close error alarm is ON (Q1.0). Network 9: In this network we have configured BUZZER for all alarms, when alarm detected then BUZZER (Q0.3) will be activated and it can be RESET by pressing RESET (I1.1). Network 10: Operator can reset the BUZZER by pressing RESET (I1.0) Test Cases Note: The above PLC Logic provided for basic idea about application of PLC in Alarm Indication of a Process. The Logic is limited and not complete application. -
PLC Program for Water filling and Discharging Process
xiangjinjiao posted A plc and hmi english article in PLC programming learning
This is a PLC Program for the Water filling and discharging process using S7-1200 PLC. Water filling and Discharging Process Problem Description In many industries or plants, there are lots of manual water filling systems are used for water storage. In the manual system, there are so many disadvantages such as Accuracy, time delay problems, loss of liquids, and Time consuming. And due to the manual system, we have to arrange an operator for machine operation. Water wastage occurs due to manual system Here we are discussing a semi-automatic system. Diagram PLC Solution To solve this problem, we will use S7-1200 PLC for programming. Here we use two sensors for level measurement, one is for High level and second is for low level. We use feeding valve (MV1) for filling Cycle of the tank and discharge valve (MV2) for discharging cycle of the tank. Both will be controlled according to sensor logic. So when the water level goes below low level then feeding valve will turned ON automatically and when water level reaches high and the it senses by high level sensor, then discharging process will be turned ON automatically. When high level is detected then buzzer will turn ON for alarm purpose. Cycle will stop if user will press stop button from the control panel. PLC Inputs and Outputs Digital Inputs Start PB: I0.0 Stop PB: I0.1 TLB 1: I0.3 TLB 2: I0.2 Digital Outputs Cycle ON: Q0.0 Valve MV1 (Feed): Q0.1 Valve MV2 (Discharge): Q0.2 Agitator/Mixer M: Q0.3 Buzzer: Q0.4 PLC Water Filling and Discharging Process PLC Program Explanation For this application, we used S7-1200 PLC and TIA portal software for programming. In Network 1 we used latching circuit for cycle ON (Q0.0) output. It can be started by pressing START PB (I0.0) and stop by pressing STOP PB (I0.1). When cycle will be started then system will check level of the tank. If tank level is low then then feeding process will start and tank level is high then Discharge cycle will start. Here we have taken NO contact for both sensors in the program for simplicity. It can be done by relay logic in field or you can use such type of sensors. When tank will detect low level then TLB 2 (I0.2) will be activated and then feeding cycle will be ON. Here we have taken NC contact of TLB1 (I0.3) so when PLC will detect high level then it will stop Feeding cycle. When tank will detect high level then TLB 1 (I0.3) will be activated and discharging cycle will be ON. Here we have taken NC contact of TLB2 (I0.2) so when PLC will detect low level then it will stop discharge cycle cycle. Mixer M (Q0.3) should be ON during discharging cycle for mixing purpose. Here we also considered an alarm for high level to inform operator. When TLB 1(I0.3) will be detected then buzzer (Q0.4) will be activated. During all function, cycle should be ON. Runtime Test Cases Note: The above PLC Logic provided for basic idea about application of PLC in Water filling and Discharging Process. The Logic is limited and not complete application. -
PLC Program for Automatic Liquid Mixing Application
xiangjinjiao posted A plc and hmi english article in PLC programming learning
Create a PLC Program for Automatic Liquid Mixing Application using ladder logic programming. Study about mixing process using a PLC ladder diagram. Liquid Mixing Application Problem Description In many industries, there are lots of mixing system used for solutions mixing. Some plants use complete automation or semi-automation. In a manual system, there are so many disadvantages such as lack of Accuracy, Time delay problems, loss of liquids, Time consumption, etc. Here we are discussing the semi-automatic application of a mixing system. Diagram Problem Solution For this example, we use PLC programming and for that we use Siemens S7-1200 PLC. For easy explanation, we can consider simple example of mixing system as shown above. In this application pure unmixed solution can be prepared by the operator using switches S1 and S2. And mixed solution or material can be prepared by the operator using switch S3. Operator observes the level of the tank and he can discharge the liquid inside tank by operating valve V5. Also the agitator motor M will be in running while tank is being filled. We will provide interlock system so operator cannot operate both switches at same time. V1, V3 and V5 are manual valves which is not connected to the PLC. V2 and V4 are electronically operated valves which can be controlled by PLC. List of PLC inputs outputs Digital Inputs There are three switches S1, S2 & S3 S1 : I0.0 S2 : I0.1 S3 : I0.3 Digital Outputs We have two valves V2 & V4. one Agitator Motor M1 V2 : Q0.0 V4 : Q0.1 M1 : Q0.2 PLC Ladder Diagram for Automatic Liquid Mixing Application PLC Program Explained For this application, we used S7-1200 PLC and TIA portal software for programming. In Network 1, we have taken NO contact of S1 (I0.0) and NC contact of S2 (I0.1) and S3 (I0.2) in series. By activating switch S1 operator can START the valve V2 for solution 1 (Liquid 1 ). In Network 2, we have taken NO contact of S2 (I0.1) and NC contact of S1 (I0.0) and S3 (I0.2) in series. By activating switch S2 (I0.1) operator can START the valve V4 (Q0.1) for solution 2 (Liquid 2). For both Networks 1 & 2, A parallel connection we have taken, NO contact of S3 (I0.2) and in series with NC contact of S1 (I0.0) and S2 (I0.1). Because of the above parallel connection, operator can operate both valves by activating switch S3 (I0.2) for mixed solution (Liquid 1 & Liquid 2) As per our condition, agitator M1 (Q0.2) should be activated automatically while tank is being filled. So we have taken NO contact of V2 (Q0.1) and in parallel NO contact of V4 (Q0.1) so agitator will be activated automatically by operating any switch. Runtime Test Cases Note : The above PLC Logic provided for basic idea about application of PLC in Liquid Mixing Application. The Logic is limited and not complete application. -
PLC Program for Two Way Switch Logic
xiangjinjiao posted A plc and hmi english article in PLC programming learning
This is PLC Program for Two ways switch logic for staircase light in house PLC Two Way Switch Logic In duplex type house there are ground floor and first floor and sometimes second floor also. Sometimes people need to go from ground floor to first floor or from first floor to ground floor by staircase provided in house. But in staircase there is no sunlight so people need a lamp/light to see the steps of the staircase easily. Here we are using a simple PLC to control this lamp using two switches, one switch at ground floor and second switch at first floor to control one lamp as shown in below figure. Note : we can also build the circuit using simple relays/switches also. This article only for understanding the basic concept of 2 way switch using a PLC Ladder Logic. Image Solution We will solve this problem by simple automation. As shown in figure consider one simple house with one floor and staircase is provided in the house. Here we will set lighting system for the users to switch ON/OFF the light whether they are on bottom of the stair or at top. We will provide separate switch for each floor as shown in above figure. PLC I/O Requirements Digital Inputs SW1 : I0.1 SW2 : I0.2 Digital Outputs Lamp : Q0.0 PLC Progam for Two-way Switch Program Explained For this application, we used S7-1200 PLC and TIA portal software for programming. In above program, we have added two NO contacts of SW 1 (I0.1) and SW 2 (I0.2) in series and NC contacts of SW1 (I0.1) and SW2 (I0.2) in parallel of this series SW1 & SW2 NO Contacts. If the status of the bottom switch (SW1) and status of the top switch (SW2) are same then lamp will be ON. And if either status of the bottom or top switch is different from other then lamp (Q0.0) will be OFF. When lamp (Q0.0) is OFF then user can ON the lamp by changing status of any switch. Also user can turn OFF the lamp by changing the status of one of the two switches. Result Note: The above PLC Logic provided for basic idea about application of PLC for Two Way Switch Logic. The Logic is limited and not complete application. -
ALLEN BRADLEY Allen Bradley PLC Subroutines
leizuofa posted A plc and hmi english article in PLC programming learning
JSR, SBR, and RET instructions are used to direct the controller to execute a separate subroutine file within the ladder program and return to the instruction following the JSR instruction. Allen Bradley PLC Subroutines The SBR instruction must be the first instruction on the first rung in the program file that contains the subroutine. Use a subroutine to store recurring sections of program logic that must be executed from several points within your application program A subroutine saves memory because you program it only once. Update critical I/O within subroutines using immediate input and/or output instructions (IIM, IOM), especially if your application calls for nested or relatively long subroutines Otherwise, the controller does not update I/O until it reaches the end of the main program (after executing all subroutines) Outputs controlled within a subroutine remain in their last state until the subroutine is executed again. When the JSR instruction is executed, the controller jumps to the subroutine instruction (SBR) at the beginning of the target subroutine file and resumes execution at that point. You cannot jump into any part of a subroutine except the first instruction in that file. The target subroutine is identified by the file number that you entered in the JSR instruction. The SBR instruction serves as a label or identifier for a program file as a regular subroutine file. The instruction must be programmed as the first instruction of the first rung of a subroutine. The RET instruction marks the end of subroutine execution or the end of the subroutine file. The rung containing the RET instruction may be conditional if this rung precedes the end of the subroutine. In this way, the controller omits the balance of a subroutine only if its rung condition is true. -
PLC Conveyor Motor Ladder Logic
leigehong posted A plc and hmi english article in PLC programming learning
PLC Programming Tutorials for PLC Conveyor Motor Ladder Logic or Conveyor Belt Control using a programmable logic controller (PLC). PLC Conveyor Motor Ladder Logic Objective: The sequential tasks as follows When START button pressed Motor will be started RUN (Green Lamp) indication lamp will be activated Motor Running, so Box will start Move Proximity Sensor will detect when the box arrives at other end Motor will be stopped RUN (Green Lamp) indication lamp will be de-activated STOP (Red Lamp) indication lamp will be activated An Emergency Stop push button will be used to stop the motor at any time. Relay Schematic R : STOP Indication lamp, G : RUN Indication lamp, M : Motor, OL : Overload Relay (Motor Protection Relay), LS1 : Proximity Switch, PB1 : Start push button, PB2 : Emergency Stop Pushbutton, CR : Contractor Relay Operational Sequence Start button is actuated. CR1-1 closes to seal in CR1 or to latch the start command CR1-2 opens, switching the red stop pilot light off CR1-3 closes, switching the green run pilot light on CR1-4 closes to energize the motor starter and motor The box/package moves, and proximity switch (LS1) detects the box when it reached and de-energize coil CR1 CR1-1 opens to open the seal-in contact ( unlatched start command) CR1-2 closes, switching the red pilot light on CR1-3 opens, switching the green pilot light off CR1-4 opens to de-energize the starter coil, stop the motor, and end the sequence PLC Ladder Logic -
PLC ladder logic programming to control valves
leizuofa posted A plc and hmi english article in PLC programming learning
Objective : To understand the basic concept of PLC Valve Control Ladder Logic. Target Users : Students, Technicians, Freshers, Trainee engineers. Note : Barrier or Relay not shown in above figure. Lets list out the required PLC digital inputs and digital output signals : PLC Digital Inputs : Valve Open Feedback Valve Close Feedback PLC Digital output : Valve Energize command PLC Valve Control Ladder Logic Programming Any pneumatic valve requires instrument air supply for its operation. A air filter regulator is used to remove any liquid or particulate matter present in the instrument air supply and to set the required air supply to the valve. The output of air filter regulator is connected to valve actuator via a Solenoid valve. This solenoid valve is used to control i.e. ON/OFF the instrument air supply to the valve actuator. Consider solenoid valve (SOV) is Normally Close (NC) type. In normal position, the SOV is in off position or de-energized state, so the instrument air supply will be blocked as SOV is Normally closed. if SOV is energized i.e. PLC sends the signal then SOV energizes and becomes normally open (NO), so allows instrument air supply through its. Some people often confuses about Solenoid valve and Valve actuator. These both are different, SOV controls (ON/OFF) the instrument air supply and Valve actuator controls the position of the valve either fully open or fully close. ON/OFF valve are equipped with either proximity switches or limit switches to sense the valve position either fully open or fully close. so these are connected to the PLC digital inputs. So PLC can know the valve status in the field either fully open or fully close and displays to the operator via graphics. Consider our ON/OFF valve is Normally Open type i.e. valve is in Open position. so by default Open Feedback will be sent to the PLC or we can say Open feedback limit switch or proximity switch will be energized and close feedback switch is in de-energize state. Lets say PLC sends an Digital output command to the ON/OFF valve (via a barrier or a relay). Say we have 24V DC powered solenoid valve mounted on the ON/OFF valve. Generally either a barrier or a relay is placed after the PLC digital output module. consider we have a barrier, first barrier receives the PLC digital output module command (PLC command is Barrier input) then the barrier energizes its output (Barrier output) and barrier sends the 24V DC power to the respective ON/OFF valve. The purpose of barrier or relay is used to isolate the PLC & Field signals or for safety purpose or to amplify the power/voltage signals. Now ON/OFF valve receives the PLC command i.e. it received the 24V DC power to the solenoid valve from the barrier. so now solenoid valve will be energized and changes to Normally Open (NC) state. Now solenoid valve passes the instrument air supply to the valve actuator as it becomes Normally open. The valve actuator receives the instrument air supply and moves the valve stem accordingly and the valve position will change from fully open state to full close state. When the ON/OFF valve starts the stem movement then immediately Open Feedback will be gone (proximity switch will not detect any object mounted on the stem). After starts valve stem movement and before reaching close position, both open & close feedbacks will not be available to the PLC and we call this as transition state. After the ON/OFF valve fully closed then close feedback switch (proximity or limit) will be energized and close feedback signal will be sent to the PLC and displayed to the operator. Note : Sometimes ON/OFF valve may stuck in between, so operator will not receive any feedback on the graphics, as both open & close feedback switches will only detect either fully open or fully close states of the valve. Its not possible to detect any Intermediate state of the valve. Say now PLC withdraws the Output command to the ON/OFF valve i.e. barrier input will be turned off, so barrier will de-energized or barrier output will be OFF, 24V DC power will be disconnected/removed to the Solenoid valve. As solenoid valve power removed, SOV changes its state from NO to NC. Solenoid valve becomes Normally Closed i.e. Instrument air supply to the valve actuator will be stopped or disconnected. So ON/OFF valve also comes into its original state i.e. Open state. PLC can send output command signal based on some logics or real time input signals. for example : if level of a drum reaches high alarm then drum feed ON/OFF valve has to be closed. Details of ON/OFF Valve : In our example we considered a pneumatic on/off valve. First we see the list of components in the valve & its purpose. a. Air Filter Regulator : Air Filters are used to remove liquid water and particulate matter from compressed air sources. These are ‘mechanical filters’ and do not remove oil vapors or chemical contaminants in vapor form. Click here for Principle & Animation. b. Solenoid Valve : A solenoid valve is an electro-mechanical controlled valve. The valve features a solenoid, which is an electric coil with a movable ferromagnetic core in its center. This core is called the plunger. In rest position, the plunger closes off a small orifice. An electric current through the coil creates a magnetic field. The magnetic field exerts a force on the plunger. As a result, the plunger is pulled toward the center of the coil so that the orifice opens. This is the basic principle that is used to open and close solenoid valves. Solenoid Valve Animation Solenoid valve Types & Principles c. Open Feedback & Close Feedback : A proximity switch is one detecting the proximity (closeness) of some object. By definition, these switches are non-contact sensors, using capacitive, inductive, magnetic, electric, or optical means to sense the proximity of the valve position either open or close. d. Valve Actuator : A valve actuator is a device that produces force to open or close the valve utilizing a power source. This source of power can be manual (hand, gear, chain-wheel, lever, etc.) or can be electric, hydraulic or pneumatic. e. Instrument Air Supply : Compressed & Dried air supply for the valve. -
How PLC Reads the Data from Field Transmitters
leizuofa posted A plc and hmi english article in PLC programming learning
Instrumentation and control rely on converting physical or process variables into a more useful format for the operator display. Pressure in a pipe is converted to mechanical deflection of a diaphragm, which is converted to electrical energy by a strain gauge (the diaphragm and strain gauge constitute a transducer), then to a numeric integer value by an I/O module, and then to a floating point engineering unit value by the PLC or HMI for display. This information is also used to help generate output commands, which are converted into electrical signals and then to mechanical action. The trick is to understand the I/O relationships of the various converters. How PLC Reads the Data from Field Transmitters For example, a flow orifice will cause a predictable pressure drop as fluids flow across it. A pressure transmitter can measure this pressure drop by comparing the upstream pressure to the downstream pressure. Though this pressure differential is not linear with flow rate, it has a repeatable relationship to it. This relationship is best approximated as a square-root function. Taking the square root of the differential pressure signal effectively linearizes it with the flow rate. After a linear relationship has been established, the entire conversion sequence from transmitter to computer display can be deduced from one measurement. The below Figure depicts two typical temperature measurement circuits as follows: The top configuration uses the external power supply of the transmitter to power the signal loop. This configuration is referred to as a four-wire loop. The bottom configuration uses an internal power supply (AI card Power) to power the loop. This configuration is referred to as a two-wire loop. The following discussion about unit conversions applies to both circuit types. Focus on the top circuit. A thermocouple is the sensing element. Thermocouples are devices that use the principle of bimetallic contact to generate a small millivolt signal. Note that the temperature-voltage curve presented in the chart is relatively linear throughout the temperature interval. Outside of that temperature interval, the signal can become less linear (a characteristic of a thermocouple), but that is of no importance here. Instrument scaling must always begin at the process measurement. The designer consults the heat and material balance (HMB) sheet for our imaginary system and finds the expected temperature at the measurement point is approximately 105°C. The upstream heater is capable of heating the system to approximately 130°C before it shuts down due to its over-temperature interlock. The design engineer knows a properly calibrated span would place the normal operating point at about the middle of the curve. The upper end would need to be above 130°C. After some thought, the engineer decides on a calibrated span of 15 to 150°C and chooses a type K thermocouple, which provides an output of 0.597 to 6.138 mV over that temperature interval. The temperature transmitter, then, must be bench calibrated to provide a 4 -20 mA output signal that is proportional to the 0.597 to 6.138 mV input signal expected from the thermocouple. The transmitter, being a current source (as opposed to a voltage source), varies its power output as necessary to maintain a steady milliamp output that is proportional to the millivolts on its input i.e. measured temperature reading. (Note: A voltage source, such as a battery, tries to maintain a constant voltage regardless of load, while a current source tries to maintain a constant current regardless of load). The temperature transmitter then converts this signal into a 4–-20 mA signal that has been scaled, in this case for a span of 15 to –150°C. The PLC has an analog input module that detects the output of the temperature transmitter. Virtually all analog input modules are voltmeters, even though they are listed as milliamp inputs. Sometimes the resistor is external on the terminal strip, and sometimes it is internal on the PLC I/O module (shown in Figure). In either case, the 4-–20 mA signal will be converted to a voltage. Typically, this voltage is 1-–5 VDC because the resistor used is 250 ohms. This analog value must then be converted to a binary value. In our example, the PLC specification lists this particular PLC I/O module as having 12-bit resolution. To find the resolution of the module in terms of the process variable, perform a binary conversion: 212 = 4095. So, for an input span of 1-–5 VDC, the PLC I/O module provides an integer value to the PLC program that ranges from 0 to 4095. The PLC program may fetch this data to use as needed. One of the possible actions of the PLC program is to move this data value into a network interface buffer (a series of contiguous locations in PLC memory) for transmittal upstream to the HMI. The raw-count integer value is then made available for data transmittal across the network. The HMI receives this transmitted data stream, which is then stored in an input data buffer. The HMI computer has a tag-file database, which contains instructions about how to manipulate each data item for presentation to the operator. Many of the tags in the tag file are linked to data items in the input data buffer. One such tag is linked to this particular location. The 0 to 4095 raw value is extracted and converted to engineering units by use of the formula embedded in either the tag-file database or the graphic screen software that uses the information. The formula in our sample case is shown in Below Figure. The value produced (85.88) would be the value displayed to the operator in oC as follows in Below Figures: -
When you design a PLC logic, you have to take care of the names that you provide to tags. It should be easily understood and interpreted by any programmer. It should neither be too long nor too short. The naming convention is important because improper tagging can cause troubleshooting issues for programmers. Also, giving lengthy names will consume the memory of PLC. So, every programmer has to follow proper naming conventions before writing a PLC program. In this post, we will see the concept of PLC tag naming conventions. PLC Tag Naming Conventions First of all, let us understand how tag naming convention plays a great role in PLC programming. You have a motor with its run command and run feedback as PLC IO’s. The motor is located in the blower room and it is used as an air compressor. The motor tag name in the P&ID is M-101. Now, for a PLC programmer, identifying a tag location is important. So, there are two types of mindsets that normally define a PLC programmer. The first will try to give as much information as possible in a tag name; so he can name the motor run command as M101_Compressor_Run_Command. The second one will try to give the name as Q_M101_Comp. The second mindset looks very clear, as he is giving short names and keeping the length as minimal as possible. This is the reason why naming a PLC tag is important, as it relieves the programmer from reading such lengthy tags in situations where urgent troubleshooting has arrived. (It is to be noted that PLC tag naming does not accept any special character apart from underscore (_) ). A PLC tag name should contain information that can help the programmer relate to the meaning of it. This generally implies the following information – data type (eg. boolean, integer), data flow (eg. input, output), scope (eg. local, global), instrument or device type (eg. motor, valve, sensor), process parameter (eg. pressure, flow, temperature) and location of the device. Tag Name Styles There are various styles according to IEC standards that must be followed for proper naming. Let us have a look at some of the most generally used: Camel Style, Pascal Style, Snake Style, Prefix with Data Type Style Camel Style In this style, there is no underscore in between. A full name is given to the whole word, but each word in it starts with a capital letter. For example, take the above-discussed example. M101_Compressor_Run_Command will be written as m101CompressorRunCommand. You can identify each word by a capital letter. The first letter will be a compulsory small letter. This style looks good if the word is small. It prevents the use of underscore and this makes memory consumption smaller. Pascal Style It is similar to the camel style; the only difference is that the first letter will be a compulsory capital letter. For example, our tag will be written as M101CompressorRunCommand. Snake Style The example that we discussed before is the snake style. Here, each word will be separated by an underscore. Prefix with Data Type Style Here, the tag will be prefixed by the data type of the tag name. In our case, the tag type was boolean. According to IEC standards, a boolean tag is usually given a prefix of ‘x’. So, our style will be written as xM101CompressorRunCommand. This helps the programmer to identify what type of data is used for that particular tag. Tips For Tag Naming in PLC Programming The first and foremost rule is that the length of a tag should be short, but not so short that no one can understand it. As discussed, the length should contain appropriate information in a proper length. Lengthy names should be strictly avoided. Follow the general tag naming styles that were discussed. These are according to IEC standards and make the logic look neat and clean. To reduce bugs during tag creation, use Excel files. Excel reduces workload in a very vast way as duplication and copying becomes very easy. Errors are hardly produced in Excel files. It is not always necessary to use a full name for a word. For example, the valve can be written as vlv and temperature can be written as temp. Avoid making the tag fully capitals. It looks cumbersome and inappropriate to read.
-
PLC Program for Temperature Control using Thermostat
leikang posted A plc and hmi english article in PLC programming learning
PLC Temperature Control: In a vessel there are Three Heaters which are used to control the temperature of the vessel. PLC Temperature Control Programming We are using Three Thermostats to measure the temperature at each heater. also another thermostat for safety shutoff in case of malfunction or emergency or to avoid over temperatures. All these heaters have different setpoints or different temperature ranges where heaters can be turned ON accordingly (below table shows the temperature ranges). A temperature control system consists of four thermostats. The system operates three heating units. The thermostats (TS1/TS2/TS3/TS4 are set at 55°C, 60°C, 65°C and 70°C. Below 55°C temperature, three heaters (H1,H2,H3) are to be in ON state Between 55°C – 60°C two heaters (H2,H3) are to be in ON state. Between 60°C – 65°C one heater (H3) is to be in ON state. Above 70°C all heaters are to be in OFF state, there is a safety shutoff (Relay CR1) in case any heater is operating by mistake. A master switch turns the system ON and OFF. PLC Solution There are four thermostats; assume them be in NC state when the set point is not reached. Let there be a control relay (CR1) to work as a safety shutoff. Master Switch : The Start switch is NO and Stop switch NC type. The below table shows the temperature ranges where Thermostats (TS1,TS2,TS3,TS4) status will be indicated as per the temperature value. Also the Heaters (H1,H2,H3) status in which either those Heaters will be ON or OFF as per the temperature value. PLC Ladder Logic Ladder Logic Operation First Rung: It has START button (default NO contact) and STOP button (default NC contact). A Relay CR1 is used to control the heaters depending on the thermostats status. A Thermostat TS4 is connected in between STOP & Relay, if TS4 activated (means TS4 contact changes from NC to NO) then all heaters will be OFF. An NO contact of Relay CR1 is used across the START button in order to latch or hold the START command. Second Rung: An NO contact of Relay CR1 is used to control the Heaters (H1,H2,H3) with the thermostats (TS1,TS2,TS3) status. After giving START command, This NO contact becomes NC contact. if temperature below 55 Deg C, TS1, TS2 & TS3 will be in Close Status so all heaters will be ON. if Temperature is in between 55 to 60 Deg C, Then TS1 will be Open, so Heater H1 will be OFF. then, if temperature in between 60 to 65 Deg C then TS2 also be Open, so Heater H2 will be OFF if temperature in between 65 to 70 Deg C then TS3 also be Open, so Heater H3 will be OFF There is a safety Shutoff which is used to avoid any malfunctions of Thermostats or to avoid over temperatures. if temperature reaches above 70 Deg C then TS4 will activates and de-energizes the Relay, thus all Heaters will be turned OFF. Note : Here Heaters H1, H2, H3 are either Relays or Contactors we energizing. so an NO contact of these relays are connected to Electrical Heater feeder circuits (MCC).These Electrical Feeder circuits will be controlled as per these signals and accordingly the heaters will be either ON or OFF. -
There are many control situations requiring actions to be initiated when a certain combination of logic functions conditions is realized in a PLC. PLC Logic Functions Say, for an automatic drilling machine, there might be the condition that the drill motor is to be activated when the limit switches are activated that indicate the presence of the workpiece and the drill position as being at the surface of the workpiece. Such a situation involves the AND logic function, condition A AND condition B having both to be realized for an output to occur. This section is a consideration of such logic functions. PLC AND LOGIC Figure 1.7a shows a situation where an output is not energized unless two, normally open, switches are both closed. Switch A and switch B have both to be closed, which thus gives an AND logic situation. We can think of this as representing a control system with two inputs A and B (Figure 1.7b). Only when A and B are both on is there an output. Thus if we use 1 to indicate an on signal and 0 to represent an off signal, then for there to be a 1 output we must have A and B both 1. Such an operation is said to be controlled by a logic gate and the relationship between the inputs to a logic gate and the outputs is tabulated in a form known as a truth table. Thus for the AND gate we have: An example of an AND gate is an interlock control system for a machine tool so that it can only be operated when the safety guard is in position and the power switched on. Figure 1.8a shows an AND gate system on a ladder diagram. The ladder diagram starts with j j, a normally open set of contacts labeled input A, to represent switch A and in series with it j j, another normally open set of contacts labeled input B, to represent switch B. The line then terminates with O to represent the output. For there to be an output, both input A and input B have to occur, i.e., input A and input B contacts have to be closed (Figure 1.8b). In general: On a ladder diagram contacts in a horizontal rung, i.e., contacts in series, represent the logical AND operations. PLC OR LOGIC Figure 1.9a shows an electrical circuit where an output is energized when switch A or B, both normally open, are closed. This describes an OR logic gate (Figure 1.9b) in that input A or input B must be on for there to be an output. The truth table is: Figure 1.10a shows an OR logic gate system on a ladder diagram, Figure 1.10b showing an equivalent alternative way of drawing the same diagram. The ladder diagram starts with j j, normally open contacts labeled input A, to represent switch A and in parallel with it j j, normally open contacts labeled input B, to represent switch B. Either input A or input B have to be closed for the output to be energized (Figure 1.10c). The line then terminates with O to represent the output. In general: Alternative paths provided by vertical paths from the main rung of a ladder diagram, i.e., paths in parallel represent logical OR operations. An example of an OR gate control system is a conveyor belt transporting bottled products to packaging where a deflector plate is activated to deflect bottles into a reject bin if either the weight is not within certain tolerances or there is no cap on the bottle. PLC NOT LOGIC Figure 1.11a shows an electrical circuit controlled by a switch that is normally closed. When there is an input to the switch, it opens and there is then no current in the circuit. This illustrates a NOT gate in that there is an output when there is no input and no output when there is an input (Figure 1.11c). The gate is sometimes referred to as an inverter. The truth table is: Figure 11.11b shows a NOT gate system on a ladder diagram. The input A contacts are shown as being normally closed. This is in series with the output ( ). With no input to input A, the contacts are closed and so there is an output. When there is an input to input A, it opens and there is then no output. An example of a NOT gate control system is a light that comes on when it becomes dark, i.e., when there is no light input to the light sensor there is an output. PLC NAND LOGIC Suppose we follow an AND gate with a NOT gate (Figure 1.12a). The consequence of having the NOT gate is to invert all the outputs from the AND gate. An alternative, which gives exactly the same results, is to put a NOT gate on each input and then follow that with OR (Figure 1.12b). The same truth table occurs, namely: Both the inputs A and B have to be 0 for there to be a 1 output. There is an output when input A and input B are not 1. The combination of these gates is termed a NAND gate (Figure 1.13). An example of a NAND gate control system is a warning light that comes on if, with a machine tool, the safety guard switch has not been activated and the limit switch signaling the presence of the workpiece has not been activated. PLC NOR LOGIC Suppose we follow an OR gate by a NOT gate (Figure 1.14a). The consequence of having the NOT gate is to invert the outputs of the OR gate. An alternative, which gives exactly the same results, is to put a NOT gate on each input and then an AND gate for the resulting inverted inputs (Figure 1.14b). The following is the resulting truth table: The combination of OR and NOT gates is termed a NOR gate. There is an output when neither input A or input B is 1. Figure 1.15 shows a ladder diagram of a NOR system. When input A and input B are both not activated, there is a 1 output. When either X400 or X401 are 1 there is a 0 output. PLC Exclusive OR (XOR) LOGIC The OR gate gives an output when either or both of the inputs are 1. Sometimes there is, however, a need for a gate that gives an output when either of the inputs is 1 but not when both are 1, i.e., has the truth table: Such a gate is called an Exclusive OR or XOR gate. One way of obtaining such a gate is by using NOT, AND and OR gates as shown in Figure 1.16. Figure 1.17 shows a ladder diagram for an XOR gate system. When input A and input B are not activated then there is 0 output. When just input A is activated, then the upper branch results in the output being 1. When just input B is activated, then the lower branch results in the output being 1. When both input A and input B are activated, there is no output. In this example of a logic gate, input A and input B have two sets of contacts in the circuits, one set being normally open and the other normally closed. With PLC programming, each input may have as many sets of contacts as necessary. PLC Exclusive NOR (XNOR) LOGIC
-
SIEMENS How to Troubleshoot Siemens PLC Programs?
xiangjinjiao posted A plc and hmi english article in PLC programming learning
This article is about the PLC programming troubleshooting method. In industrial PLCs where thousands of inputs and outputs are used, and we know how lengthy PLC programs are, depends on the application or plant usage. Troubleshoot Siemens PLC Programs Some times, People may change the logic parameters unknowingly and it may lead to a fault. Even some faults are created during the logic design stage due to the complexity of the design. The siemens plc software has different handy tools available in it to troubleshoot the faults generated in the programs. Faults can be like overlapping of addressing, multiple same output instances, memory bit address overlapping, many times a single program is used to work over and over, etc. To find out such problems, there are four types of windows available in the siemens software which will help us to troubleshoot the issues. They are: Cross Reference Call Structure Assignment List Dependency Structure Let discuss how to use them in our program for troubleshooting and where to find them in the software. Cross Reference Cross-reference is used to find all the digital & analog inputs and outputs used in the logics. It will help us to know about the number of times the I/O’s are used in the program and also take users directly to the specific location of the I/O’s in the logic pages. Here is an example of one of the programs, in which you can see how the cross-reference table looks like. It contains all the information like addressing, the language of the program, used inputs and outputs, etc. Call Structure When you want to know which block is used in programming then call structure is used. This is a reversal of cross-reference function in which we get to know that how many times SFC, FB block are used in OB (Organization Block) and here we get to know that how many times OB used in SFC and FBs. Assignment List The assignment list is a very useful feature when it comes to knowing that how many inputs, outputs, timers and counters used in our application and how many of them are still remaining, so we can use them in future logics. Dependency Structure Dependency structure is used to show where each and every block used within the programming. But in step 7 it won’t take you directly on location however in TIA PORTAL it will take you to the location where the program is written. NOTE: To open these windows in step 7, use the info as shown in Drawing. After clicking on display you have the options. In TIA PORTAL, follow the below step shown in the drawing. -
PLC Program for Daily Production Record
xiangjinjiao posted A plc and hmi english article in PLC programming learning
PLC Program for Daily Production Record. Learn the problem description with a detailed explanation of the ladder logic. Daily Production Record Problem Description In many industries, It is required to count the number of products that are made in one day and it is very necessary for selling the products or tracking the production quantity on a daily basis. In the olden days, human operators were allotted for counting the final products but because of some human errors, precise counting is not possible. Therefore we cannot get proper counting of all products and are unable to track the production quantity effectively. Mostly these types of problems occur in food and beverage industries, box packaging industries, bottle filling applications etc. So we can use a simple PLC based logic to track the daily production and to record it electronically. Problem Diagram PLC Solution Here we will solve the problem of counting of final products by using sensors and PLC programming. First sensor sense the product and counts the quantity and the value will be shown on the digital display (as shown in above figure). For easy explanation, we will consider one simple example of empty box counting system. In this system empty boxes are travelling form first process to second process (say one place to another). Sensor is used for counting the empty boxes. So when sensor will detect empty box then display will start , say starts count from 1 and this is done by simple logic. Every 24 hours / after one day, we can reset the counter value by using RESET button. Here we will consider two batches of production for easy explanation. And also we have considered two batches completion indications for operator for each batch which will display on the Local Panel. By PLC logic we will implement the desired logic. So when any batch will be completed then indication lamp will be ON as per PLC program. Once production target will be completed, display counter can be reset by using RESET button. List of Inputs/Outputs Inputs List Box detector Sensor: I0.0 Reset: I0.1 Main SWITCH: I0.2 Outputs List Target completed: Q0.0 Batch 1 completed: Q0.1 Batch 2 completed: Q0.2 Ladder Diagram for Daily Production Record PLC Program Description In this application, we have used Siemens S7-1200 PLC and TIA Portal Software for programming. Network 1: In Network 1 we used Main SWITCH (I0.2) to start the system/batch and we used NO contact of box detector sensor (I0.0) in series. Here we considered one UP counter so when box detector sensor (I0.0) detects the box then counter will starts counting. Here also we have taken target completed output (Q0.0) for target completion indication for the operator indication on the panel. By pressing RESET button (I0.1) operator can RESET the old production record. Counter operation is used to count the products, in which RESET (I0.1) used for reset the production record. And Preset value (PV) is 20 products. Counter value (CV) is MW2 indicates the actual number of products detected by sensor & this value will be used in the following rungs to track the batch status. Network 2: In Network 2 we used batch1 logic from counter block output CV. Here we used comparator for counting 10 boxes for batch 1 and when it will be completed then batch 1 completed lamp (Q0.1) will ON. In this add equal to equal comparator in which input is (MW2) and for 10 products. Network 3: In network 3 we used batch 1 logic from counter block output CV. Here we used comparator for counting 20 boxes for batch 2 and when it will be completed then batch 2 competed lamp (Q0.2) will ON And this way we can decide that how many products and batches are produced. Runtime Test Cases Note: The above PLC Logic provided for basic idea about application of PLC in industrial production record. The Logic is limited and not complete application. -
Multiple Pumps Control using PLC
leikang posted A plc and hmi english article in PLC programming learning
Write the PLC program to control multiple pumps using programmable logic controllers. We have two input pumps used to fill a tank. Make sure pumps operate in an equal amount of time over their lifetime. Multiple Pumps Control using PLC Program Logic: Develop ladder logic program according to the logic given below, The start/stop push button is provided for control of the two input pump motors P1 and P2. The Start/Stop pushbutton station is operated to control pump P1. When the tank is full drain pump motor P3 is started automatically and runs until the low-level sensor is actuated. After 3 fillings of the tank by pump P1 control automatically shifts to pump P2. The operation of the start/stop pushbutton now controls pump P2. After 3 fillings of the tank by pump P2, the sequence is repeated. PLC Program: Program Description: Rung 0000: Start/Stop PB latched with memory B3:0/0. Rung 0001: B3:0/0 enabled to turn on B3:0/1 which is to turn ON PUMP P1 (O:0/0) when low-level sensor(I:0/3) turn ON and High-level sensor (I:0/2) is in off condition.B3:0/1 is latched with low-level sensor because pump p1 should not go off once water started rising. Rung 0002: Memory contacts used to turn on PUMP P1 (O: 0/0) with counter (C5:0). Since we are going to shift pump operation from P1 to P2, two counters are used to shift between Pl and P2. Counter C5:1 is used to turn on PUMP P2(O:0/2). Rung 0003 & 0004: B3:0/0 enabled to turn on B3:0/2 which is to turn on PUMP P3(O:0/1) when high-level sensor(I:0/2) turn ON and low-level sensor (I:0/3) is in off condition.B3:0/2 is latched with high-level sensor because pump p3 should not go off once water started reducing. Rung 0005: When Pump 3 (O: 0/1) is running, the low-level sensor turns on will make Pump p3 off and pump P1(O:0/0) ON. Rung 0006: Both Counter reset is done once the second counter (C5:1) done bit turns ON. Conclusion: We can use this example to understand the programming logic in AB PLC.