Jump to content
  • PLC programming technology and HMI interface design English database

    PLC, DCS, HMI and SCADA product application technical articles

    leikang
    This is the PLC Program to implement SR flip flop in PLC. Learn the PLC programming with this example logic.
    SR Flip Flop using PLC Ladder Logic
    Problem Description
    Implement a program for SR flip-flop logic in PLC using ladder language.
    Problem Diagram

    PLC Solution
    As we know, more complex systems cannot be controlled with combinational logic alone. The main reason is that we cannot, or choose not to add sensors to detect all conditions. In these cases we can use event to estimate the condition of the system.
    SR flip flop is used for Latch on or unlatch – to lock something ON or turn it OFF.
    Most PLC has special instruction for SR flip flop function. so no custom logic required for such types of PLCs. SR flip flop first executes SET function and then RESET function.
    Note :- Here we are considering simple function of SR flip flop instruction without using special instruction or using latch function. Here we are using simple latching circuit for SR flip flop function.

    Here as shown in figure two push buttons or two inputs are taken for program implementation.
    When user will press SET button or 1 is received at S input, Q output will be ON and if RESET button pressed or 1 received at R input, Q^ will be ON.
    List of inputs/outputs
    Digital Inputs
    Set Input :- I0.0 Reset input :- I0.1 Digital Outputs
    Q output :- Q0.0 Q^ output :- Q0.1 M memory
    Relay coil 1 :- M0.0 Relay coil 2 :- M0.1 PLC Ladder Diagram to implement SR flip-flop



    Program Explained
    For this PLC program we use S7-300 PLC and TIA portal software for programming. We can implement this logic by using other PLC also.
    Network 1:
    Here we used NC contact of relay coil 1(M0.0) so when reset button is pressed, Q output (Q0.0) is OFF.
    Network 2:
    Here we used NC contact of relay coil 2 (M0.1) so when set button is pressed, Q^ output (Q0.1) is OFF.
    Network 3:
    Here when we press RESET button (I0.0), relay coil 1(M0.0) will be latched.
    Network 4:
    Here when we press SET button (I0.1), relay coil 2(M0.1) will be latched.
    If both the inputs are low during power up, Q^ output (Q0.1) will go high because of its order. If both the inputs are
    Note :- Above application may be different from actual application. This example is only for explanation purpose only. We can implement this logic in other PLC also. This is the simple concept of implementing SR flip function without instruction. we can use this concept in other examples also.
    All parameters considered in example are for explanation purpose only, parameters may be different in actual applications.
    Result


    leikang
    This is a PLC Program to read the temperature in PLC. Learn PLC programming using example problems and solutions.
    Read Temperature in PLC
    Problem Description
    Write a PLC program in which we can monitor the actual temperature.
    Here we are using an external temperature controller and its output is also connected to PLC for monitoring the temperature of material in the tank.
    Problem Diagram

    Problem Solution
    RTDs devices with resistance that changes with temperature changes in a linear way.
    This resistance value will change as temperature changes and by supplying a constant current, the measured voltage drop across the resistor can be used to determine the new resistance, and thus the temperature.
    RTDs come in a variety of types, with the most common type is a PT100. It’s made from platinum that has been calibrated to be 100 ohms at 0 degrees C.
    In above application, we want to measure material temperature of the tank, for that we use RTD sensor which will measure temperature of the tank and give signal to the temperature controller.
    Temperature controller will send signal in the form of voltage (0-10V DC).If RTD detect 0degree temperature, it will send 0V DC and if maximum temperature detected, it will send 10V DC to PLC.
    Temperature controller is directly connected to the PLC so PLC will read voltage.
    Note: – Here we consider simple application for explanation. We need to measure material temperature of the tank by using RTD sensor. And also consider other components for control purpose.
    Assume Scaling range of temperature controller is 0-100°C=0 to 10V DC and according to this signal PLC consider 0 to 27648.
    I/O List
    M memory
    Analog value from the temp controller :- MW100 Actual value from the temp controller :- MD104 Multiplication :- MD108 Actual temperature in °C :- MD112 PLC Ladder diagram to read the temperature


    PLC Logic Explanation
    For this application, we used S7-300 PLC and TIA portal software for programming. We can implement this logic by using other PLC’s also.
    Network 1:
    In this network, we implement logic for value conversion. It is necessary to convert value from INT to DINT for multiplication purpose or for calculation. So by using conversion instruction analog value from the RTD (MW100) is converted into actual analog value (MD104).
    Note:- Temperature controller provides 0-10V DC signal to PLC. ADC converter or analog input module will convert this analog signal into digital form, and the range of this digital signal is 0 to 27648. This digital range may change from one PLC to another.
    Network 2:
    we have the RTD temperature range which is 0 to 100 degc and the output voltage range is 0 to 10V DC. So we need to scale this voltage output in terms of temperature reading. Here multiply the value as per equation and final value will be stored in MD108.
    Note:-Here temperature controller and temperature measurement range is 0-100°C.
    Network 3:
    Now for final result multiplied value is divided by 27648, result will be stored in MD112 (Actual temperature in °C).
    Note:- Above application may be different from actual application. This example is only for explanation purpose only. We can implement this logic in other PLC also. This is the simple concept of temperature reading in S7-300 PLC, we can use this concept in other examples also.
    All parameters considered in example are for explanation purpose only, parameters may be different in actual applications.

    leikang
    This is a PLC Program to implement analog scaling in S7-300 PLC.
    Control Valve Scaling
    Problem Description
    Implement PLC program in S7-300 for analog scaling.
    Problem Diagram

    Problem Solution
    Analog inputs come from different sensors or transmitters. Transmitters convert physical quantity into electrical signal. We can measure many physical quantity by using analog sensors such as temperature, pressure, level, distance, flow etc.
    Of course we can measure all physical quantity by using analog sensors, but for example and explanation purpose here we take one example of control valve.
    As shown in figure, here we consider one control valve and it has 4-20mA output (valve feedback)  and 4-20mA input (valve command) for operation. Hence, when PLC will give 20mA to flow control valve, valve will be open 100% and for 4mA it will be 0% (close).
    In other way flow control valve is also providing output signal that can be used for close loop system/for valve percentage indication. If valve is 100% open, PLC will get 20mA signal and for 0% it will get 4mA.
    Note:- We consider here close loop system for simple explanation, so operator will set control valve open command parameter in range between 0% to 100% .

    Now as per close loop system, control valve will provide output signal (valve feedback) and by using SCALE instruction, operator can see actual valve open parameter on graphics.

    List of inputs/outputs
    M memory
    Enable command-Scaling :- M0.0 Bipolar selection-Scaling :- M0.1 Actual value from the sensor or transmitter :- MW10 Error word –Scaling :- MW12 Scaled output :- MD20 Enable command-Unscaling :- M1.0 Bipolar selection- Unscaling :- M0.2 Given value from the display :- MD24 Error word-Unscaling :- MW16 Unscaled output :- MW26 PLC Ladder Diagram for Valve Scaling

    Ladder Logic Explained
    For this application, we use S7-300 PLC and TIA portal software for programming. We can implement this logic by using other PLC also.
    Network 1:
    In this network, scaling logic is executed when Enable command (M0.0) is ON.
    The “Scale” instruction is to convert the integer (here 4-20mA signal from the control valve or MW10) at the IN parameter which can be scaled in physical units between a low limit (0% output) and a high limit (100% output).
    The result or scaled output (MD20) of the instruction is output at the OUT parameter.
    If bipolar selection (M0.1) is ON, it is assumed that the value at the IN parameter is bipolar (range between -27648 to +27648).
    If bipolar selection (M0.1) is OFF, it is assumed that the value at the IN parameter is unipolar (range between 0 to 27648).
    Network 2:
    The “Unscale” instruction is used to unscaled the floating-point number (given value from the display or MD24) on the IN parameter into physical units between a low limit and and a high limit.
    The result of the instruction is output (unscaled output MW26) at the OUT parameter. If bipolar selection (M0.2) is ON, it is assumed that the value at the IN parameter is bipolar (range between -27648 to +27648).
    If bipolar selection (M0.2) is OFF, it is assumed that the value at the IN parameter is unipolar (range between 0 to 27648).
    Error code table:

    Note: The above application may be different from actual application. This example is only for explanation purpose only. We can implement this logic in other PLC also. This is the simple concept of SCALE and UNSCALE instructions, we can use this concept in other examples also.
    All parameters considered in the example are for explanation purposes only, parameters may be different in actual applications.
    Result


    caixiaofeng
    Make a PLC program to implement a totalizer for the flow meter. The flow meter has 4-20mA output that represents 0 to 100 liters/hour fuel flow in a pipe.
    PLC Program for Flow Totalizer
    By using this logic, we can calculate total fuel passed from the pipe.
    When the totalizer value reaches 5000 liters, then automatically it should be reset or we can reset the value using the RESET button.

    Problem Solution
    We can solve this problem by simple logic. Here we consider a flow meter for measuring the fuel with a maximum flow rate of 100 liters/hour.
    Here we will convert this flow rate from L/H to L/Sec by using DIV instruction for calculation.
    After that by using 1 second clock pulse, we will store this value in another memory location and every second new value will be added & updated.
    Here for example we consider the max value for the totalizer to be 5000 liters so after this value totalizer should be RESET.
    So we will compare this value with the actual value and reset it automatically or we will provide a RESET button to reset the totalizer value.
    List of Inputs/Outputs
    Inputs List
    Reset:- I0.0 M Memory
    M0.5:- 1 second (1s) clock pulse M1.2:- Positive edge of clock pulse MD10:- Memory word for final output (L/H) of flow meter MD18:- Memory word for final output (L/Sec) of flow meter MD22:-Total liters addition MD26:-Total fuel in liter Ladder Diagram for Totalizer



    Program Explained
    In this problem, we will consider S7-300 PLC and TIA portal software for programming.
    Network 1:
    Here we have taken final output value of the flow meter in L/H (MD10). By using DIV instruction we converted L/H flow into L/sec and final value stored in MD18.
    Network 2:
    Here clock pulse of 1s (M0.5) will add value every second and store the result in memory word MD22.
    Network 3:
    Here we moved value of MD22 in MD26 (total fuel in liter) for display purpose.
    Network 4:
    In this network we need to reset totalizer. If total fuel is greater than 5000 (5000 value is for example purpose, it is depended on flow meter configuration & it’s range ) then totalizer count should be zero automatically or we can reset by pressing RESET button (I0.0).
    Note: The above logic is for explanation purpose only. Here we have considered only final output of the scaling, so we have not mentioned 4-20mA scaling in the logic.
    Result


    xiangjinjiao
    This is a PLC Program for Blinking (ON/OFF) lamp at 5 seconds interval.
    Blinking Lamp
    Problem Description
    Make the Indicator or lamp ON after five seconds and OFF after five seconds.
    Make a program which switch ON lamp for 5 seconds, then OFF for 5 seconds, then ON for 5 seconds & again OFF for 5 seconds, and so on.
    Problem Diagram

    Problem Solution
    This problem can be solved by using timers. In this case we will use TON (ON Delay Timer).
    For explanation we consider one SWITCH for enabling the ON/OFF cycle and one lamp for output.
    When user presses the SWITCH then lamp will energize and remains ON for 5 seconds after that it will OFF for 5 seconds. This cycle will repeat itself.
    List of Inputs & Outputs
    Inputs List
    SWITCH : I0.0 Outputs List
    Lamp : Q0.0 M Memory
    M0.0 : bit memory for lamp OFF condition. PLC Ladder Diagram for Blinking Lamp


    Program Explanation
    In this problem, we will consider S7-1200 PLC and TIA portal software for programming.
    Network 1:
    In this network when SWITCH (I0.0) is pressed, when the lamp OFF condition is not present then the lamp (Q0.0) will be ON.
    So here we used NO contact of SWITCH (I0.0) and NC contact of lamp OFF condition (M0.0).
    Network 2:
    In this network when lamp (Q0.0) is ON then TON (ON delay timer) instruction will be executed and it will set the lamp OFF condition.
    So we have taken here NO contact of lamp (Q0.0), TON timer and programmed time is 5 seconds.
    Network 3:
    As per our condition, lamp OFF condition (M0.0) should be OFF after 5 seconds delay, so we have used TON again.
    So we used NO contact of lamp OFF condition (M0.0) and TON with 5s programmed time.
    Result


    xiangjinjiao
    This is a PLC Program for Positive edge pulse output for one scan cycle. Learn the ladder logic with the solution.
    Positive Edge Pulse Output
    Problem Description
    In some applications, we need to run an operation/function based on external input signal. We can use a digital input as trigger command to activate that required function.
    Sometimes we use positive transition of the digital input signal to trigger the command instead of continuous/full pulse digital input signal.
    Here we consider an example of simple logic in which two registers values will be increment after receiving the trigger command. Each register have a preset value say value “1”. So on every trigger command, the adder register values will be increment by value “1”.
    For adder 1 register we use positive edge (0 to 1) triggered input and for adder 2 register we use simple digital input  (0 to 1 & 1 to 0) signal. We see the advantages and disadvantages of using triggering command with and without using positive edge.
    We can use the same logic in other applications like Zeroing the register values, forcing the register values with defined value with little logic modification etc.
    Problem

    Solution
    We can solve these types of problem by positive edge or rising edge of the digital input. Here we will consider S7-300 PLC for programming, so we can monitor the value and simulate it. We can use PLC SIM for simulation purpose. Here we have considered one simple example. In this example we will consider “Adder 1” register which will add value “1” when transition occurs from 0 to 1 of the trigger command. The register value will be incremented by value 1 after each triggering. For “Adder 2” register, the value will be incremented after receiving the digital input. Here, we are not used the positive edge triggering. List of Inputs/Outputs
    Inputs List
    Trigger Command : I0.0 Memory Coil
    Positive Edge of trigger command : M0.0 Total Value : MW2 Total Value 2 : MW4 PLC Ladder Logic
    Network 1:
    The initial value of “Adder 1″register is zero. After giving positive edge triggering command for 18 times, the output will be value 18 as it increments by value “1”.

    Simulation (PLCSIM-300) for trigger command with positive edge.

    Network 2:
    The initial value of “Adder 2″register is zero. After giving triggering command (without positive/negative edge) for 18 times, the output will come some random number (say 7506) instead of value 18 as trigger command directly received.

    Simulation (PLCSIM-300) for trigger command without positive edge.

    PLC Logic Description
    In this application, we have used Siemens S7-300 PLC and TIA Portal Software for programming. Here we have considered two examples for positive edge explanation. Anyone can easily understand the concept. In Network 1, when trigger command (I0.0) is triggered then transition will occur from 0 to 1 and positive pulse instruction will be executed. Say “Adder 1″register will be stored with value “1” in MW0, if trigger command (I0.0) will be triggered then the value will be incremented by “1”. Here for example, we have triggered 18 times when adder 1 is zero, so adder added 18 in total Value (MW0) Another example we have taken in Network 2,  without using positive pulse. so here you can see the result. Say, We have pressed or triggered 18 times but it added 7506 (this is random value it can be different during simulation) in total Value 2 (MW4) so it is not proper addition. Because one pulse have rising or falling edges / positive or negative pulses (o to 1 and 1 to 0). Here also we have used PLC SIM for simulation, so we can simulate the total addition. In first network we have added positive edge so simulator is showing 18. In second network we have added trigger command without positive edge so it is showing some random value. This is the concept of positive edge, we can use this positive edge during any programming application. Above program and simulation is only for explanation purpose and simulation value can be different at simulation time. Result

    Note: The above PLC Logic provided for basic idea about application of Positive edge trigger command in PLC Logic. The Logic is limited and not complete application.

    xiangjinjiao
    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.

    xiangjinjiao
    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.

    xiangjinjiao
    This is the PLC Program for Automatic Lamp Control in Godown (Storage Facility).
    Automatic Lamp Control
    Problem Description
    In the old process, when the person enters the godown (Storage facility), he/she pressed the switch and all lamps in the godown will be ON. If we turn on all lamps together then more energy consumption occurs.
    This problem occurs in the old process, so solutions are required for this process. We can solve this problem using simple automation or an interlock system.
    Problem Diagram

    PLC Problem Solution
    We can solve this problem by simple interlock using PLC. As shown in the figure, consider one godown (storage facility) for industry and there are a couple of segments in the facility.
    For example, we have considered only three segments for the storage facility. Say here we have 3 lamps for 3 segments and 3 switches for operation.
    When a Person enters the godown (storage facility) for some work, he will operate lamp 1 by pressing switch 1. When work is completed then operator will turn OFF the light.
    Here we will provide an interlocking system so a person cannot operate another segment’s lamp until he stops the first segment lamp. The same case occurs in other segments.
    So by using this automation/interlock circuit, we can save energy.
    Note: This type of interlock applies only to some types of storage facilities as these are operated by working in one segment at a time only before going to the next segment in the storage facility.
    List of inputs/outputs
    Digital Inputs
    SW1: I0.0 SW2: I0.2 SW3: I0.3 Digital Outputs
    Lamp 1: Q0.0 Lamp 2: Q0.1 Lamp 3: Q0.2 PLC Ladder diagram for Automatic lamp ON/OFF

    PLC Program Description
    For this application, we used S7-1200 PLC and TIA portal software for programming.
    Network 1:
    In the above program, we have taken NO contact of SW 1(I0.0) for operating the Lamp 1 (Q0.0) and given NC contacts in series. so when the user press other switches, Lamp 1(Q0.0) will be OFF.
    Network 2:
    In network 2, we have written logic for Lamp 2(Q0.1). By operating SW2 (I0.2) operator can operate Lamp 2(Q0.1). And given NC contacts in series, so when user press other switches, Lamp 2(Q0.1) will be OFF.
    Network 3:
    In network 3, we have written logic for Lamp 3(Q0.2).By operating SW3 (I0.2) operate can operate Lamp 3(Q0.2). And given NC contacts in series, so when user press other switches, Lamp 3(Q0.2) will be OFF.
    Runtime Test Cases

    Note: The above PLC Logic provided for basic idea about application of PLC Program for Automatic Lamp Control. The Logic is limited and not complete application.

    xiangjinjiao
    This is a PLC Program for Automatic Parameter initialization when power up.
    Parameter Initialization When Power UP
    Problem Description
    In many applications, it is necessary to initialize some data when the machine is powered up.
    Sometimes due to power failure, the value in some parameters becomes zero.
    Due to this problem, the operator has to feed all data again or every time during power failure.
    When the machine gets powered up, at that time necessary parameters should be initialized automatically.
    Here we discuss this issue with some basic ladder logic.
    Problem Diagram

    Problem Solution
    In this case, we need to write the logic in the PLC program so all parameters will be initialized automatically.
    We can also set a manual initialization button so the operator can initialize data while the machine operation is running.
    Here we will consider the machine set speed as data and it will be initialized automatically when the machine turns on.
    If the operator wants to reinitialize the set speed during the running cycle then he needs to do it through the initialization button.
    PLC Ladder diagram
    Here is the PLC program Automatic Parameter initialization when powered up.

    List of PLC inputs/outputs
    Inputs List Parameter Initialization Button : I0.0 MW10 : Set Speed form Display Outputs List
    Mw12 : Speed for drive Program Description
    For this application we use S7-1200 PLC and TIA portal software for programming. This logic is used for parameter initialization. For first scan, we used here S7-1200 facilities of system Memory. Every PLC have its own system memory. Always ON bit, always OFF bit, first scan bit, and diagnostic status changed are the system memory for S7-1200 PLC. We can configure any memory address “M” for system memory. Here we configured M1.0 for first scan bit which is used for parameter initialization. We write for parameter initialization in Network 1. Here we use NO contact of First scan bit (M1.0) for moving initial 5 RPM in MW12(Speed for drive).By using MOVE instruction 5 RPM will be moved in MW12 . Add NO contact of Parameter Initialization Button (I0.0) for moving Initial 5RPM in MW12 (Speed for drive) manually. For editing data manually in running cycle we write logic in Network 2. Here operator can enter data in MW10 (SET SPEED) from the display and it will go in MW12(Speed for drive). For Example, Say we need to enter 100 RPM speed from display it will be written in word MW10 (Set Speed from display) and as per logic it will be moved in MW12 (Speed for drive), so motor will run on 100 RPM. Runtime Test Cases

    Note: The above PLC Logic provided for basic idea about application of PLC Program for Automatic Parameter Initialization when Power UP. The Logic is limited and not complete application.

    xiangjinjiao
    This is a PLC Program for Latching and an unlatched circuit for output.
    PLC Latching and unlatching Circuit
    Problem Description
    In some conveying systems, the operator fills the tank manually by operating the water pump manually.
    In this situation operator waits when the tank is being filled because when the tank reaches to high level, the water pump should be stopped.
    Also water pump should remain in ON condition until the tank reaches a high level.
    For example, we consider a manual water conveying system in this article.
    Problem Diagram

    Problem Solution
    In this example, we consider one storage tank for water and use one water pump for tank filling.
    We also use one level sensor for high level and control panel for operator.
    Here START PB for enabling the motor so we can feed the water in the tank, for stop motor we use STOP PB.
    Level sensor for detection of High level so when tank becomes full, high level sensor will be activated and stops the water pump.
    For this sequence we will use SET and RESET instruction for latching and unlatching the water pump.
    We can make this circuit by sing relays.
    In application there one manual discharge valve only for discharging the tank manual. We will not consider in or logic.
    PLC Inputs List
    START PB : I0.0 STOP PB : I0.1 HIGH LEVEL SENSOR : I0.2 LOW LEVEL SENSOR : I0.3 PLC Outputs List
    WATER PUMP : I0.0 PLC Ladder diagram for Latching and unlatched circuit

    Program Description
    For this application we use S7-1200 PLC and TIA portal software for programming. We can make this circuit or logic with relay also. This circuit or logic known as latching and unlatching circuit or logic. We will write logic for water pump in Network 1. Here we use NO contact of START PB (I0.0) for enabling the water pump (Q0.0). By using SET instruction water pump output coil (Q0.0) will be latched. Add NO contact of LEVEL LOW SENSOR (I0.3) in series with the water pump output (Q0.0). Water pump should not start if tank is full. so for safety purpose use one NO contact of LOW LEVEL SENSOR (I0.3) in series after START PB (I0.0) in Network 1. Now HIGH LEVEL SENSOR (I0.2) will be detected after some time of pump running and in this case water pump (Q0.0) should be stopped automatically. For that purpose we need to unlatch the circuit. We will write logic for unlatching circuit in Network 2. In this case,  we take No contact of HIGH LEVEL SENSOR (I0.3) for unlatching the circuit by using RESET instruction. Add one NO contact of STOP PB (I0.1) in parallel connection, so operator can unlatch the circuit by pressing STOP PB (I0.1). Here we latch circuit by SET instruction and unlatch with RESET instruction. Runtime Test Cases

    Note: The above PLC Logic provided for basic idea about application of PLC Program for Latching and unlatching Circuit. The Logic is limited and not complete application.

    xiangjinjiao
    This is the PLC Program for Conditional Logic Circuit. The below example is based on the ladder logic using a programmable logic controller.
    PLC Conditional Control Logic
    In Industry or plants, there are lots of gearbox systems used for different machines/motors.
    For smooth operation of gearbox motors, they need to be lubricated every time because good maintenance work can extend gearbox life.
    But the problem is that operators often make mistakes during machine operation because in every gearbox motor mechanism, we need to start lubrication first and then the main gearbox mechanism should start.
    So we have to implement a logic to make sure things are properly controlled from a PLC system.
    Problem Diagram

    Note: For easy discussions, Local/Remote, or any other permissive interlocks are not considered in this example.
    Problem Solution
    Here we solve this problem by using a simple conditional logic example, in this example, there is one gearbox motor and we need to provide lubrication before starting it.
    So for lubrication, we have a lubrication motor (also called as Oil Pump or Auxiliary Lube Oil Pump) and it will provide lubrication oil to the main motor or gearbox motor.
    Also, we will provide an interlock system, so the operator cannot start/operate the Main motor directly without using proper lubrication otherwise the main motor may overheat and it may be damaged after some runs without proper care.
    The operator has to switch ON oil pump first and then only he can able to operate the main motor.
    By using this logic, we can take care of the gearbox motor for a long time run with proper lubrication.
    Operators start/stop oil pump by using START and STOP push buttons of oil pump.
    Both Oil Pump and Main Motor have separate individual START & STOP push buttons as shown in above diagram.
    PLC Inputs List
    Oil Pump StART PB : I0.0 Oil Pump STOP PB : I0.1 Main Motor START PB : I0.2 Main Motor STOP PB : I0.3 PLC Outputs List
    Oil Pump Motor : Q0.0 Main Motor : Q0.1 PLC Ladder diagram for conditional Control Circuit

    Ladder Logic Description
    In this application, we used Siemens S7-1200 PLC and TIA Portal Software for programming. We can also design this logic with relay circuit. This circuit is also known as conditional control circuit because second sequence is depended on first condition. We will write logic for oil pump in Network 1. Here we will take NO contact of oil pump START PB (I0.0) and also we have to consider one NO contact of oil pump (Q.0) coil for latching START command. Put NC contact of oil pump stop PB (I0.1) in series for unlatching the circuit by pressing oil pump STOP PB (I0.1), so operator can stop the oil pump (Q0.0). Now write the logic for main motor in Network 2. Here we will take NO contact of main motor START PB (I0.2) and also take one more NO contact of the main motor coil for latching the main motor (Q0.1). Put NC contact of main motor stop PB(I0.3) in series for unlatching the circuit by pressing the main motor STOP PB(I0.3), so operator can stop the main motor(Q0.1). Put NO contact of oil pump (Q0.0) in series after the main motor START PB(I0.2) for interlocking. So that operator has to start oil pump (Q0.0) and then only he can START the main motor (Q0.1). Runtime Test Cases

    Note: The above PLC Logic provided for basic idea about application of PLC Program for Conditional Control Logic. The Logic is limited and not complete application.

    leizuofa
    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.

    leizuofa
    When electric motor is started, it draws a high current typical 5-6 times greater than normal current.
    In DC motors there is no back emf at starting therefore initial current is very high as compared to the normal current.
    To protect the motor from these high starting currents we use a star and delta starter.
    Simply in Star connection, supply voltage to motor will be less. so we use star connection during starting of the motor, after motor running we will change the connection form star to delta to gain full speed of the motor.
    Star Delta Motor Starter
    The following figure shows the winding connections in star and delta configuration one by one.

    It can be seen that in star connection, one end of all three windings are shorted to make star point while other end of each winding is connected to power supply.
    In delta configuration, the windings are connected such that to make a close loop.
    The connection of each winding is shown in above figure. In actual motor the three phase connections are provided in the following order as shown

    So in order to make winding connection in star and delta style in practical motor, the connection is shown above.

    Main contractor is used to supply power to the windings. It must be turned on all the time. Initially the star contactor is closed while delta contactor is open It makes the motor windings in star configuration.
    When the motor gains speed, the star contactor is opened while delta contactor is closed turning the motor windings into delta configuration.
    The contactors are controlled by using PLC. The following section of PLC tutorial will explain the ladder programming for star delta motor starter.
    PLC program for star delta motor starter :

    PLC Ladder Logic

    Rung 1 Main contactor :
    The main contactor depends upon the normally open input start push button (I1), normally closed stop button (I2) and normally closed overload relay.
    It means that Main contactor will only be energized if start button is pressed, while stop is not pressed and overload relay is not activated.  A normally open input named (Q1) is added in parallel to the start button I1.
    By doing so, a push button is created which means that once motor is started, it will be kept started even if start button is released
    Rung 2 Star contactor:
    Star contactor depends upon main contactor, normally close contacts of timer (T1), and normally close contacts of output delta contactor (Q3).
    So star contactor will only be energized if main contactor is ON, time output is not activated and delta contactor is not energized.
    Timer T1:
    Timer T1 measures the time after which the winding connection of star delta starter is to be changed. It will start counting time after main contactor is energized.
    Rung 3 Delta contactor:
    Delta contactor will be energized when main contactor (Q1) is energized, timer T1 is activated and star contactor (Q3) is de-energized.
    Also see Programing of push button and other requirements for simple motor starter is explained in PLC Tutorial: Motor starter
    Note : This post for educational or reference purpose only. For a live  circuit, there will be some additions to the above circuit like safety related, as per application, some interlocks etc.

Apply for friendship links:WhatsApp or E-mail: admin@plchmis.com
×
×
  • Create New...