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

    PLC, DCS, HMI and SCADA product application technical articles

    leikang
    When you hear about PLC programming, the five used languages in it are – ladder logic, structured text, functional block diagram, sequential flow chart, and instruction list. Any language, once understood, can be used for writing an application code and running a machine properly.
    Best PLC Programming Language

    Figure – Sample Ladder Logic
    But often, new PLC programmers get confused as to what to use for writing a program. If he understands a language’s advantages and disadvantages, then he can easily determine what to use for writing a PLC program. So, it is necessary to understand the difference between them and define which language to use for coding. In this post, we will see which language is best for PLC programming.
    Ladder Logic
    Ladder Logic is the most basic type of PLC programming language. It can easily be correlated to an electrical wiring control diagram. Traditionally, electrical control wiring was used to operate outputs according to the inputs provided.
    The ladder Logic drawing consisting of contacts and coils was implemented in the same way in the ladder logic programming. You have a series of rungs, each rung having contacts and coils. When the rung is powered up, the coil, depending upon its type, operates accordingly.
    You can write as many rungs as required in a program and the code will execute accordingly. When you see it, the resemblance is similar to a ladder, and thus, the name is given ladder logic. Refer to the below diagram for understanding. You can see how simple it is to get through.

    In the above illustration, inputs associated with a switching device in the relay logic diagram are shown as contacts in the Ladder Diagram. The M1 output coil in the relay logic diagram is represented with an output coil symbol in the Ladder Diagram.
    The address numbers appearing above each contact/coil symbol in the Ladder Diagram are references to the locations of the external input/output connections to the logic controller. So, in between two end power rails, you can place the required elements and write the logic in them. The rungs execute in a cyclic manner from top to bottom.
    Structured Text
    Structured Text can be said as the local IT-level language. The resemblance of structured text language is very similar to codes that we write in a software language. As the name implies, Structured Text is a series of texts written in an assignment way.
    Instructions must be terminated with semicolons. When an assignment is performed, the current value of a single or multi-element variable is replaced by the result of the evaluation of the expression.
    An assignment consists of a variable specification on the left side, followed by the assignment operator: =, followed by the expression to be evaluated. Both variables (left and right sides of the assignment operator) must have the same data type. Refer to the below diagram for understanding.

    As you can see, it has different types of operations and conditions. In the above example, an if-else statement is used to evaluate an expression. If the condition is true, then the variable assigned on the output side turns on and when the condition goes false, then the variable will turn off. ST language is thus best for mathematical calculations, as it looks sober and easy to understand.
    Sequential Flow Chart
    A sequential Flow Chart is the most advanced tool when you want to write complex programs in a repetitive way or sequential way. As the name implies, SFC language allows you to write a program through a flow chart. It works in steps, branches, links, jumps, and transitions.
    An SFC section is a “Status Machine”, i.e. the status is created by the active step and the transitions pass on the switch/change behavior. Steps and transitions are linked to one another through directional links.
    Two steps can never be directly linked and must always be separated by a transition. The active signal status processes take place along the directional links and are triggered by switching a transition. Refer to the below image for understanding.

    The direction of the chain process follows the directional links and runs from the end of the preceding step to the top of the next step. Branches are processed from left to right. Every step has zero or more actions.
    A transition condition is necessary for every transition. The last transition in the chain is always connected to another step in the chain (via a graphic link or jump symbol) to create a closed loop. Step chains are therefore processed cyclically.
    Functional Block Diagram
    The Functional Block Diagram (FBD) language that is generally used in microprocessors, is available in a similar format in PLC programming too. It is a diagram of blocks connected with each other, with each block having its input and output.
    FBD language is very easy to troubleshoot because you can literally view the whole code in a single view, rather than scrolling up and down. This helps in quick maintenance and also increases the efficiency of the programming. Refer to the below image for understanding.

    As you can see, you can connect various types of functions and blocks easily by lines, which shows how a flow is happening in the logic. You just have to assign input and output pins, connect the lines between these pins and your code works accordingly.
    Instruction List
    A program written in Instruction List language consists of a series of instructions that are executed sequentially by the logic controller.
    Each instruction is represented by a single program line and consists of the following components – line number, current value which can be seen online only, instruction operator, and operand. Refer to the below image for understanding.

    You can see that each line executes one single operation only. Instead of contacts and coils used in ladder logic, you have load instructions and set/reset instructions corresponding. It is a mixture of ladder logic and structured text. That is why, it is also called as similar to an assembly language. When you go online in the PLC, you can see animated values in this window.
    When we see these five languages, we see that the most ones that are generally used by programmers are ladder logic, structured text, and functional block diagram. Every language has its merits and demerits. But, these three are simple to understand, interpret, and design. This helps the programmer in designing the logic properly.
    That does not mean that the remaining two languages are not used. It depends on the skills of the programmer on what he has to use to implement the coding. So, it is difficult to comment on the best language; but yes, out of these three too, the most used is the ladder logic.

    leikang
    When you develop a PLC logic, you always need timers and counters. Any cycle in an automation process is generally incomplete without the use of timers and counters. You need them to execute a task after a certain time or keep the task on / off for a certain time. Its use depends on the application to be developed.
    And, before going deeply into advanced instructions of PLC, a programmer must first understand these basic blocks to implement them properly and to get assistance in learning the advanced blocks more easily.
    In this article, we will learn the difference between timers and counters in PLC programming.
    What is a Timer?
    A timer is an instruction that is used to turn on or off an output after a certain delay. For example, if you want to turn on a lamp after 5 seconds, then use a timer to execute this task.
    A timer will take an input and when the input turns on, then its timing will start. After the time of 5 seconds elapses, then the timer output will turn on which turns on the lamp indirectly. This we are talking about is the normal timer on the type.
    A timer has more two types – timer off and pulse timer. In short, the basic function is the same – execute a task after a certain delay.

    Refer to the above image for understanding more correctly. A timer has four inputs and outputs – input, set value, current value, and output. An input takes the condition for starting a timer, a set value is used to take the set timer value, the current value shows the current timer value running and the output is used to turn on or off the variable connected to it.
    When the PLC timer gets the input and if the set value is 5 seconds, the timer starts as 1, 2, and 3, and so on till 5. When 5 seconds have been completed, the output turns on. When the input goes off, the timer’s current value immediately goes to zero.
    Whether the timer was running or not; if the input is off, then the timer will not start and its output and current value will be zero. This is the functioning of a TON (timer on delay) timer.
    What is a Counter?
    A counter is an instruction that is used to turn on an output after a set count has been reached. The count can either increment or decrement.
    For example, if you want to turn on a lamp after a push button has been pressed five times, then use a counter to execute this task. A counter will take an input and when the input turns on, then its count will increment to 1.
    When the input goes off, nothing will happen. When it again receives the input, the count will increment to 2. After the count of 5 elapses, then the counter output will turn on which turns on the lamp indirectly. This we are talking about is the counter-up type.
    A counter has one more type – counter down. In short, the basic function is the same – execute a task after a certain count.

    Refer to the above image for understanding more correctly. A counter has five inputs and outputs – count input, reset input, set value, current value, and output. A count input takes the condition for counting, reset input takes the condition for resetting the counter, the set value is used to take the set counter value, the current value shows the current counter value running and the output is used to turn on or off the variable connected to it.
    When the counter gets the count input and if the set value is 5, the counter increments to 1 and so on till 5; at the receipt of each pulse in the count input (means the count input will have to be turned on and off 5 times). When 5 counts have been completed, the output turns on.
    Now, even if the count input pulse is given, the counter will go on increasing after 5 and the output too will remain on. To again bring back the counter state to zero, you have to give reset input. When this input is given, the counter current value becomes zero and the output too turns off. So, it is similar to latching-type functioning. To unlatch the counter, you will have to reset it. This is the functioning of a CTU (count up) counter.
    Difference between Timer and Counter
    The main differences between timers and counters in a PLC are as follows.
    A timer needs to have its input continuously for turning on a variable, but a counter need not to have its input continuously. So, a timer works on continuous conditions, whereas a counter works on pulse conditions. If the timer input is removed, then its output will go back to zero states; but if the counter input is removed, then to the counter will hold its last value. A timer does not have reset input, whereas a counter requires reset input to get back the counter to its original state. The types of timers are – timer on, timer off, and timer pulse. The types of counters are – counter up and counter down. A timer set value can be in seconds, minutes, or milliseconds; but a counter set value is a fixed integer.

    leigehong
    PLC programming has many types of instructions and operands in it for executing logic. One of the most used instructions is a counter.
    A counter is used for counting numbers. Counting is required for many applications; for example, even a small logic like counting the number of bottles passed in a minute requires a counter for it. If such a small application needs a counter in it, then automation technologies have many bigger types of logic in it which use counters for use. So, these are important types of instructions used in PLC programming.
    There are two categories of counters available – normal counters and step counters. In this post, we will learn the difference between normal counters and fast counters.
    What is a Normal Counter?
    There is no official term called a normal counter in PLC. It is just a definition used to show the two basic types of counters – step up and step down. As the name implies, these instructions are used to count numbers when it is given an input pulse.
    Suppose you have a push button and you want to count how many times it has been pressed. If you understand what we are trying to convey, push means it will remain on as long as it is pushed. As soon as you remove it, it goes off.
    This means it is a pulse-type input, and the counter understands only such types of input. If the input remains continuously on, then it will not count. It counts only when the input goes from on to off state, and then again repeats the same sequence.

    Refer to the above image for understanding. CU (count up) input is used to increment the counter whenever input is received. As it is a trigger, the count increments when a pulse-type input is received. PV input is the set value. As long as the set counts are not achieved, then the output of the counter (Q) will remain off. When the set value is reached, then the output turns on.
    Now, even if the count input is given, the count will go on incrementing and the output will remain on. To turn it off, reset input is to be given which resets the counter and makes the current value zero. This is the general working of the counter.
    What is a Fast Counter?
    The fast counter is the same as a normal counter, but the only difference is that it counts very fast types of inputs. Suppose you have a proximity sensor, which turns on or off for example 1000 times in 30 seconds. Such fast inputs are difficult to detect in a normal counter, as it has a lower scan time. The fast counter will do this job by counting the number of pulses received at its input in a quick manner.
    Similar to a normal counter, its output turns on after a set value is achieved, and it requires a reset input to reset the counter and turn off the output. The fast counter can work in frequencies of 5 kHz.
    Because Fast Counter function blocks are managed by specific hardware interrupts, maintaining maximum frequency sampling rates may vary depending on your specific application and hardware configuration. Not all PLC inputs can be used as fast counters; it has only some dedicated PLC inputs for assigning a fast count function.
    As you can see, the only difference between both these counters is the speed of functioning, as a normal counter cannot accept any fast type of input.

    leikang
    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


    leikang
    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


    leizuofa
    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


    caixiaofeng
    In a previous article, we talked about the firmware version of your PLC and how to handle errors that might happen due to a firmware mismatch between your project in the TIA Portal and your actual PLC.
    In this article, we will show how to update the firmware version of your PLC.
    Contents:
    What is a firmware version? Why firmware version can cause me trouble? How to know the firmware version of your hardware PLC? How to handle firmware version errors? How to update the firmware version of your PLC? Conclusion. What is a firmware version?
    As we explained in a previous article, the firmware of a PLC or a PLC module (IOs, Communication modules, etc.) is simply the internal software installed in the PLC which is responsible for what the hardware can actually do.
    A PLC with an older firmware version will have fewer features and internal capabilities than a newer firmware version PLC.
    Pictures 1 and 2 show you how the same hardware PLC will have different features and performance capabilities with different firmware versions installed.

    Picture 1. Firmware version V4.0

    Picture 2. Firmware version V4.4
    You can see that the CPU is now having more features added just by updating to a higher firmware version. With the higher firmware V4.4, the CPU now has OPC UA among other features added to its performance capabilities.
    Why Firmware Version Can Cause Trouble?
    You will select your PLC in TIA Portal according to one of two points:
    You already have purchased the hardware PLC, so you will select the same PLC that you actually have in the TIA Portal project. You still haven’t purchased a PLC, so you will select a PLC in TIA Portal that meets your requirement then you will buy it later. In either of the two cases, if the firmware version of the PLC selected in the TIA Portal project is different from the firmware version of the actual hardware you will have a problem. And in some PLCs, your program won’t even be downloaded to the hardware PLC.
    So, you should always make sure that the firmware version of the actual PLC matches the PLC selected in TIA Portal.
    It is worth mentioning to know that if the firmware version selected in TIA Portal is older than the actual PLC, you won’t face any troubles with your program, you will lose some of the PLC features and capabilities, but your program will work fine.
    Troubles will appear if the opposite is true, if the firmware version selected in TIA Portal is newer than the actual PLC, then you will have a problem.
    That is why if you don’t know the firmware version of your hardware, you should select the older version in the TIA Portal project. 
    How to Know the Firmware Version of Hardware PLC?
    We can know the firmware version of the hardware PLC that we have by one of two methods:
    From the PLC itself: The firmware version of any PLC or PLC module is always written somewhere on the hardware device.
    From the TIA Portal software: Using the TIA Portal software, you can connect your PLC to your TIA Portal and search for the device then you can find the firmware version of the hardware device. We showed how to do that in the previous article.
    How to Handle Firmware Version Errors?
    If the firmware version of the actual hardware PLC is older than the version of the PLC selected in the TIA Portal project this will cause firmware errors, and to solve these errors we can try one of the following approaches:
    we can select the PLC in the TIA Portal project to be with the same or older firmware version as the actual PLC. We showed that in the previous article. we can update the firmware version of the actual hardware PLC to a higher firmware version than the selected one in your project or at least to the same firmware version. And that is the scope of this article. How to Update the Firmware Version of your PLC?
    You can update the firmware version of your PLC in two ways:
    Online using TIA Portal. Off-line using Siemens Memory Card SMC. Update the firmware Online using TIA Portal:
    You don’t need to have an existing project open in the TIA Portal, just you need the TIA Portal software and connect the PLC to your PC. See picture 3.

    Picture 3. Open Tia Portal without creating a new project.
    When you open TIA Portal, go to online access, choose the suitable communication adapter between your PLC and your PC, and then press update accessible devices to search for your PLC. See picture 4.

    Picture 4. Find your PLC.
    After the PLC is found as you can see in the previous picture, open the PLC folder and press online and diagnosis to see the PLC firmware version. See picture 5.

    picture 5. The current firmware version of PLC.
    NOW, to update the firmware version, press the Firmware Update attribute. See picture 6.

    picture 6. Firmware update page.
    As you can see, when you press the Firmware Update attribute, you can see the current firmware update which is V4.1.3, and also you can see the Firmware Loader where you can browse for the firmware version that you want to install.
    Off course you have to have the firmware version on your PC first, which means we need to download the firmware version. To download the firmware version, you should log in to your Siemens account, if you don’t have one you can easily create a new account, but it will take 1 or 2 days to be activated.
    After that, you can search for the firmware version for your PLC. In our case, we have an S7-1200 CPU 1214C AC/DC/RLY and we will search for its firmware version using its article number. See picture 7.

    Picture 7. Search for the firmware version of your PLC.
    After that download the firmware version you want to install, in our case, we want to update our PLC to V4.4.0, so we will download this version to our PC. See picture 8.

    picture 8. Download V4.4.0
    The downloaded file will be a zip file, you should unzip the file to get the firmware version data file and then go back to the Firmware Loader attribute and click browse to search for the firmware version. See picture 9.

    picture 9. Search for the firmware version file.
    Don’t worry about making a mistake at this step, because if the firmware version is not compatible with the PLC, you won’t be able to run the update. See picture10.

    picture 10. The update will not continue if the firmware doesn’t match.
    As you can see, when we tried to upload a firmware version for a 1215C CPU into our PLC with a 11214C CPU, it gave an error that the file is not suitable for the PLC.
    NOW, click browse again, but this time search for the correct firmware version. See picture 11.

    picture 11. No error message when the firmware version is correct.
    As you can see, when we choose a suitable firmware version, there was no error message and we can now press Run Update to start updating our PLC.
    A Firmware update window will appear once you start the update process and a success message will appear at the end, if the update went smoothly. See pictures 12 and 13.

    picture 12. A firmware update is running.

    Picture 13. firmware update finished successfully.
    Now that the firmware version is updated, refresh your communication by re-pressing Update Accessible Devices and checking the PLC firmware version.
    You will find the PLC is now of firmware version V.4.4.0 instead of V4.1.3, and that means we managed to update the firmware version of our PLC. See picture 14.

    Picture 14. Firmware is updated to V4.44.0
    And that is how we update the firmware version of our PLC using TIA Portal.
    Offline using Siemens Memory Card SMC:
    The other method that can be used to update the firmware of our PLC is by using the SIEMENS memory card SMC.
    To do so, we just have to download the firmware version we want to use then we will copy the firmware version from our PLC to the SMC and then insert the SMC into the dedicated slot in the PLC. The next time the PLC is powered on, the firmware will be updated.
    Conclusion
    You can update the firmware version using the TIA portal software or the SIEMENS SMC memory card. Make sure you are choosing the firmware version exactly right, if there is a mismatch between PLC and TIA Portal the update will not start.

    caixiaofeng
    In a previous article, we talked about what a PID is, and we also explained the different parameters of a PID and how the system would react to changing these parameters. In this article, we will show how to program, configure and tune a PID in your TIA Portal project.
    Contents:
    How to add a PID to your logic? How to configure the PID? Basic setting process value setting Advanced setting How to perform tuning of the PID? Pre-tuning of the PID Fine-tuning What are the different tuning methods of PIDs? How to add a PID to your logic?
    In TIA Portal and almost every other PLC platform, you don’t have to program a PID controller as the TIA Portal already has built-in blocks for PIDs. To add a PID into your logic you just have to simply drag and drop the PID block into your code and just start configuring it for your system.
    Adding PID into your code is very simple, however, there is a very important point you should take into your consideration. This is the execution interval of your PID.
    As you know the main execution cycle is happening inside Main Cyclic OB1 and the cycle time of the OB1 depends on a lot of factors, like how long your code is, mathematical calculations in your code, and also for loops and sequences, all of these different factor would make the cycle time of your OB1 not only might it make it long but also it will make it different each cycle, depending on the coding you have.
    That means if you called your PID block inside the main OB1, the PID execution will depend on the cycle time of your OB1, and that is not a best practice approach.
    PIDs are usually used to control physical parameters like pressures, temperatures, or speeds and that means your controller needs to be very fast in figuring out any change in your process value and taking fast reactions to counter-effect this change and give you a smooth stable control that a PID should have. So if the PID is added to the main OB1 and is affected by its execution time, it might need to action delays and it will make your system not stable.
    What to do?
    A best practice is to call your PID block in a cyclic interrupt OB and set the cycle time of this cyclic interrupt to whatever value you see fit for your system, usually in the range of milliseconds depending on your application. That means, if you set the cyclic interrupt for example to 1 millisecond your PID will be called and executed every millisecond regardless of where the main OB1 cycle is.     
    So, to add a PID into your logic we start by adding a new cyclic interrupt OB and give it a proper name. See picture 1.

    Picture 1. Adding a cyclic interrupt into your project.
    You can see from the picture that we set the cyclic time to 1000 microseconds or 1 milliseconds. So our PID will be called and executed every millisecond.
    Now that you added your cyclic OB to the project, you can simply drag and drop the PID block. You can find it in the Instructions tab/Technology/PID control/Compact PID. See picture 2.

    Picture 2. Adding the PID block.
    Now, add your system parameters to the PID block, the input, output, and setpoint. See picture 3.

    Picture 3. Assign your PID parameters.
    Did you notice from the last picture, you have 2 different inputs and 3 different outputs, what are those?
    Input:
    This is your input value of your process parameter in real actual physical quantities, we will use our tank simulation system, so the input here in that case is the tank fill level in liters. That means you have made your analog input scaling somewhere else in your project and you just supply the PID with the actual fill level in liters.
    Input_PER:
    This is the input value of your process parameter but comes from the analog input module. That means it will not be scaled and it will be in the range of 0-27648 and the scaling of the input will be done inside the PID.
    Output:
    In this case, the PID will give you the controller output value in the range of 0% to 100% of the maximum output value.
    Output_PER:
    The same as input_PER, the PID will give the output in the form of 0-27648.
    Output_PWM:
    In this case, the PID will give its output signal in the form of ON/OFF pulses, so either there is an output or not. And the output value is then 100% when it is ON and 0% when it is OFF.
    We will use the same tank simulation system we used before, and as you can see from the previous picture, we used the Input and Output_PER as our simulation is built this way.
    How to configure the PID?
    To enter the configuration view of the PID, you can either click the configuration tab in the project tree or from the small configuration icon above the PID block itself. See picture 4.

    Picture 4. Entering configuration view.
    This will take you to the functional view where you can configure the different settings of your PID. See picture 5.

    Picture 5. Controller type setting.
    The first configuration is the controller type, and here you can choose what type of control you want to use, you have a lot of options from the shown drop-down menus like temperature, pressure, length, and many more. You can also set it to general, where the system will see your values as %. In our system, we are controlling water liters inside a tank, so we will choose volume.
    You can also set the Manual/Auto mode of the PID.
    Next, you want to configure the input/output parameters. See picture 6.

    Picture 6. Input/output parameters.
    Here you can choose from the different types of inputs or outputs as we explained before. As we said we will use the Input and Output_PER.
    Next, you need to configure your process value setting. See picture 7.

    Picture 7. Process value limit.
    In this step, you will set the low and high limits of your process value. If you choose the Input type. Then this setting will be open to change, and you can set the limits of your process. In our case, the tank limits are 0 to 50 liters. So we set it to these values.
    Note that, if you choose the Input_PER this setting won’t be available to you and you can only set your process limit from the next tab. See picture 8.

    Picture 8. Process value scaling.
    If you use the Input_PER, then as you see from the previous picture you can set your process value limit with respect to the 0-27648 scaling you have.
    If you want to set up a warning when your process value hit a low or a high limit, then you can configure that in the process value monitoring tab. See picture 9.

    Picture 9. Process value monitoring.
    Next in the setting list you will find the PWM limits, see picture 10.

    Picture 10. PWM limits
    in here you can set the minimum ON and OFF time of your output, imagine you have a pump or a valve in your system that the PID is controlling through a PWM output, you don’t want the PID to just give your pump a train of a very fast based ON/OFF behavior because that will probably cause your pump to burn out. So you can tell the PID from this setting to turn the pump on for a minimum time before closing it and vice versa.
    You can have the same control with your PID if you don’t have PWM output from the next setting, the output value limits. See picture 11.

    Picture 11. Output value limits.
    You can control the low and high limits of your control output, for example, you can make the low limit 20% and that will make the PID run the pump for at least 20% of its flow. So your control range will be from 20% to 100%.
    Finally and most importantly, you can set your PID parameters in the configuration mode from the next tab, the PID parameters tab, see picture 12.

    Picture 12. PID parameters.
    Here you can write the tuning parameters for your PID gains P, I, and D in case you know them or in case you made the tuning yourself and you have the parameters from elsewhere.   You can also choose to decide to use a PID or just a PI controller.
    If you don’t have these parameters, you can upload them automatically after you make tuning to your PID.
    How to Perform Tuning of the PID?
    Now that you finished your PID configuration, you can tune your controller just as easily from the commissioning tab in the project tree. See picture 13.

    Picture 13. Commissioning your PID
    On the commissioning page, you have your screen divided into 3 parts, the upper page is where you can start pre-tuning and fine-tuning the PID.
    In the middle, you will have a graph area to show you the real-time response of your system. You can see the controller output and the process value. And each time the set point changes, you will see the behavior of your PID to catch this new set point. Even if the set point didn’t change but for example the demand from our tank supply is increased, you will see the PID reaction to supply that demand and also keep the set point at its required value.
    In the third area, you will have the online status of your controller and you can also decide the operating mode of your PID. See the following simulation video showing the auto-tuning procedure of the PID in the TIA Portal.
    From the video, you can see that after pre-tuning is done, our PID found the P, I, and D parameters to best suit our system. You can see that when the set point or the outflow changes the controller will react very quickly to bring the set point back to the required values.
    You can now upload your tuning parameters directly into your project with a simple button click, see picture 14.

    Picture 14. Upload your parameters.
    Once you have uploaded your parameters, you can find them in the PID parameters tab in the configuration view. See picture 15.

    Picture 15. PID parameters.
    The next step should be to perform a fine-tuning procedure to the PID from the same commissioning view, however, because we don’t have a real system and we are just simulating the behavior of the tank and pump using mathematical calculations we can’t do the fine-tuning step.
    When you have a real system you can make the fine-tuning where your PID will try to find the parameters that will give the system a better response and even eliminate the overshoot of your process value and directly reach the set point.
    In the future, if we have a real system, we can show what it looks like.
    What are the different Tuning Methods of PID Controller?
    You don’t have to make the tuning of your PID using TIA Portal; there are many different methods that try to find the best PID parameters for your system. It is mostly mathematical methods based on trial and error. I would recommend using the auto-tune feature in TIA Portal.
    But here are some of the methods used to achieve the same parameters.
    Heuristic tuning. Ziegler-Nichols tuning method Cohen-Coon tuning method Kappa-Tau tuning method Lambda tuning method And a few others. Conclusion
    Use a cyclic interrupt with your PIDs. Configure your PID to best suit your system. The auto-tune feature in TIA Portal is very useful and effective.

    xiangjinjiao
    PLC is a very important part of industrial automation. It is the base of automation and every PLC programmer or automation engineer must design it properly so that it works properly. It is not just about programming, but ultimately how you design the PLC system.
    Safety Considerations in PLC System Design

    We all think that if write a program properly with all the interlocks, sequence, and flow properly, then our PLC system is ready to use. But, it must be noted that one of the most important parameters in designing any system is safety. So, similarly, a PLC system must be designed considering safety in mind. In this article, we will learn the safety considerations when designing a PLC system.
    Power Supply
    This is the first and foremost parameter in considering PLC design. There are two types of power supplies in the panel – DC and AC. DC is usually 12-24V DC and AC is usually 110V AC or 230V AC.
    PLC is powered up by either of the supplies and the field instruments too are powered up by either of the supplies. If a panel has a single SMPS or 230V single bus bar, then it becomes easy for designers to wire the system. If a panel has multiple power supplies, then there are chances that you will connect a positive wire from one supply and a negative wire from another supply by mistake. This will instead complex your system and make troubleshooting harder. So, a single power supply also minimizes line interference and prevents faulty input signals coming from a stable AC source to the power supply and CPU.
    Multiple power supplies are unwanted and also create more chances of short circuits and frequent breakdowns. So, power supply design is a very important factor for safely operating the PLC system.
    Earthing
    Earthing, as we all know, is required to pass any leakage current to the ground. This prevents electric shock, noise, and electromagnetic interference. The standard neutral to earthing voltage must be less than 0.5V in industrial areas.
    A slightly higher side of 1V is acceptable, but if it is above that, then it means the earthing is not proper and leakage happening in electrical signals will hamper the performance. PLC power supply, and IO channels, must be properly grounded and connected to the earth bus bar in the panel.
    Also, instrument earthing and power earthing must be separate; otherwise, any merge in the earthing will create short circuits or interference in signals.
    Critical Digital Input Signals
    Every PLC system must have critical inputs like emergency stop, panel power failure, and air pressure. Also, all these signals must be connected in NC (normally closed) format.
    The emergency stop is used to stop the system suddenly when an operator presses this button, panel power failure is used to stop the system when there is any problem in the phase power supply, and the air pressure signal denotes whether air is required to operate valves or other pneumatic outputs is proper or not.
    All actions should stop immediately if any of these inputs fail. In some large systems, it is also observed that if the emergency is pressed, then instead of stopping the whole system, provide an emergency stop for individual large rating outputs. Due to this, the operator can isolate every system easily and operate other systems instead of stopping the whole system.
    Manual Mode Interlocks
    Programmers always take manual mode logic lightly. Just turning on or off the outputs is their motive. However, it must be noted that any irregular operation of outputs manually can hamper the system’s performance. If the system is very critical, then it can cause life-threatening issues to the personnel nearby.
    So, it is recommended to apply alarms or other critical interlocks in manual mode too. This prevents the operator from operating the system randomly. Also, the safety of the PLC system is ensured due to this logic.
    Alarms
    All alarms given in a control logic document are usually taken by the programmers in the program. However, PLC programmers must provide some additional safety alarms in the system, according to IO’s taken in the PLC.
    These are usually run feedback alarms, trip feedback alarms, over or under travel alarms, sensor failure alarms, PLC channel failure alarms, thermal overload alarms, thermostat alarms, over or under voltage alarms, etc. These alarms vary from system to system, based on the actual inputs taken.
    But, if any of these inputs are not there, then it is recommended that programmers suggest the same to customers for considering them. This prevents the system from operating in a malfunctioning way.
    In this way, we saw some general safety considerations when designing a PLC system.

    leikang
    When you are working in a PLC system, you know that the most basic thing to take care of is memory. What program you write, and how much memory has been consumed; is a very important factors in determining PLC performance. For this, it is necessary to understand how memory structure is organized and defined in a PLC.
    PLC Memory Organization

    Without knowledge of memory organization, it would be difficult to predict how much exact program you have to write. In this post, we will see memory organization in PLC. Memory in a PLC is divided majorly into two types – data files and program files.
    Data Files
    The data file is the location of memory which stores information like memory words, status words, input variables, output variables, communication variables, timers, counters, and other in-built library functions provided by the PLC manufacturer.
    Let us have a look at each example one by one.
    Memory words – Memory words are Boolean variables, integer variables, double integer variables, and floating variables. Suppose a PLC has allocated 100 memory variables for usage. Out of these, only 5 variables are used. The first variable is bit type, storing either 0 or 1. The second variable is an integer, signed or unsigned. The third variable is also an integer. The fourth variable is a double integer, signed or unsigned. If a variable is a double integer or float, it consumes two memory variables. So, the fifth memory variable will be a double integer. Status words – Status words store information about PLC. It comes in two types – status bits and status integers. Input variables – They store data regarding digital inputs and analog inputs of the PLC. Output variables – They store data regarding digital outputs and analog outputs of the PLC. Communication variables – They store data regarding communication protocols used in PLC. They can be Modbus, Ethernet, Can-Open, etc. Apart from these, other in-built libraries if used to come in data files memory. They are timers, counters, pulse blocks, etc.
    Program Files
    As the name defines, program files store data regarding logic written, subroutines, and interrupts. This is the main consuming part of memory in PLC. If the PLC code written is more, then program file consumption will be large and if the code written is less, then program file consumption will be less. All the logic, be it a ladder, functional block diagram, structured text, sequential flow chart, or instruction list, comes in program files memory.
    Also, user-defined function blocks and user-defined data types come in program files.
    Memory organization in PLC is stored in either internal storage or internal and external SD cards. When there arises a situation where the internal memory storage is getting full and you need more data for the writing PLC program, then you need to insert an external SD card for extending program memory.
    In that case, both the data files and program files are extended. Many PLCs have an online animation window, which shows current memory usage. It can be viewed either online or offline. This helps in better memory planning.

    leigehong
    In the Programmable Logic Controllers (PLCs) and Distributed Control Systems (DCS), the selection between Hardwired I/O and Serial I/O becomes especially critical due to the real-time nature of these systems and the associated complexities of industrial processes.
    Below, I break down the characteristics of each in these specific systems.
    Hardwired I/O
    The main points we have to discuss about the Hardwired I/Os are listed below.
    Direct Connection Real-time Response Wiring Complexity Limited Flexibility Reliability Signal Integrity Suitability Safety-Critical Applications 1. Direct Connection
    Hardwired I/Os are directly connected to the PLC or DCS. Each input or output device has a dedicated line running back to the controller.
    2. Real-time Response
    These I/Os are generally designed for real-time control tasks. They are especially used in time-sensitive applications like process control, interlocks, and emergency shutdowns, where immediate action is required.
    3. Wiring Complexity
    For large systems with numerous I/O points, hardwired solutions can become cumbersome, requiring extensive cabling and larger control cabinets.
    4. Limited Flexibility
    Modifying or expanding a hardwired system can be labor-intensive due to the need for physical rewiring.
    5. Reliability
    Hardwired I/Os are often deemed more reliable for critical tasks due to their straightforward, point-to-point nature, reducing the risk of communication failures.
    6. Signal Integrity
    The signal integrity is usually better with hardwired connections, especially in environments with a lot of electromagnetic interference (EMI) when compared to serial communication.
    7. Suitability
    Best suited for smaller systems or in scenarios where reliability and speed are of the utmost importance.
    8. Safety
    Hardwired I/Os are mostly used in safety-critical applications like industrial process control applications where the control loops are critical.

    Serial I/O
    The main points we have to discuss about the Serial I/Os are listed below.
    Data Serialization Protocol-based Communication Scalability Networking Capability Data Handling Distance Vulnerability Cost Safety 1. Data Serialization
    Serial I/Os transmit data one bit at a time, usually over a single data line. This is in contrast to parallel systems that send multiple bits simultaneously. We have individual wires for each signal in hardwired I/Os but the serial I/Os generally have a single cable for transmitting/receiving all the data.
    2. Protocol-based Communication
    They usually rely on established industrial protocols like Modbus, PROFIBUS, or Ethernet/IP for communication, which standardize the data exchange between devices.
    3. Scalability
    Serial I/Os are generally more scalable. Adding more I/O points often merely requires configuring the existing network, with no need for additional cabling back to the controller.
    4. Networking Capability
    Serial I/Os can easily be networked and often feature built-in diagnostics, making them more versatile but also adding complexity.
    5. Data Handling
    Serial I/Os are more versatile when it comes to data handling. They can transmit more complex data types, including real numbers and strings, over the network.
    6. Distance
    They are better suited for applications where I/O points are located far from the PLC or DCS controller. We may be in need of some special devices like repeaters, gateways, etc for some cases.
    7. Vulnerability
    Because they are protocol based, serial I/Os can be more vulnerable to issues like data collisions, latency, and other network-related issues.
    8. Cost
    While initial setup costs may be higher due to networking hardware, the long-term cost can be lower, particularly for systems requiring frequent modifications or scaling.
    9. Safety
    Serial I/Os are never used in safety-critical applications as the main cable damage may lead to complete data failure.
    Choosing Between Hardwired and Serial I/Os
    The choice between the two often hinges on various factors such as system size, required speed of operation, safety, data complexity, and cost considerations. Engineers usually make a detailed analysis, sometimes even using both types in different sections of a single PLC or DCS system to leverage the advantages of each. For instance, hardwired I/Os may be used for safety-critical applications, while serial I/Os may be used for data collection and monitoring tasks.
    Comparison between Hardwired I/Os and Serial I/Os
    The below table shows the differences between Hardwired I/Os and Serial I/Os.
    Parameter Hardwired I/Os Serial I/Os Connection Type Direct, point-to-point connection Protocol-based, usually networked Data Transfer Speed Generally faster, real-time processing Can be slower due to serialization (depending on the protocol) Complexity Can be slower due to serialization (depending on protocol) More manageable complexity Scalability Difficult and expensive to scale Easier and less costly to scale Reliability Higher due to fewer points of failure Can have more points of failure Wiring Extensive cabling required Less cabling, often just a single data line Signal Integrity Better in environments with high EMI Can be susceptible to EMI Data Types Supported Generally 4-20 mA analog signals, 24 V DC for digital signals. This may be higher due to networking hardware Distance Suitable for shorter distances Can handle longer distances Cost (Initial) Lower for small systems and Higher for larger systems High (Depends on the Protocol) Cost (Maintenance) Higher due to complexity of troubleshooting Generally lower Flexibility Limited; hard to modify Highly flexible; easy to modify Redundancy Difficult and expensive to implement Easier and less costly to implement Safety Applications Often used for safety-critical tasks Less commonly used for safety-critical tasks Network Diagnostics Limited or none Often built-in When it comes to safety in PLCs and DCS systems, Hardwired I/Os and Serial I/Os have different characteristics that can either enhance or potentially compromise the safety of an industrial process.
    Below is a comparison table focused solely on the safety aspect of these two types of I/O systems.
    Safety Aspect Hardwired I/Os Serial I/Os Reliability Generally higher reliability due to direct connections and fewer points of failure. Protocol and network-based, introducing more points of potential failure. Real-Time Responsiveness Excellent for real-time response, often used in emergency shutdowns and safety interlocks. Can experience latency due to network congestion or protocol limitations, making them less ideal for immediate action. System Complexity Lower complexity generally makes it easier to identify and address safety issues. Complexity of networking and protocols can make it challenging to identify the root cause of safety concerns. Signal Integrity Less susceptible to electromagnetic interference (EMI), enhancing signal quality and reliability. Potentially more susceptible to EMI and signal degradation, which could compromise safety. Data Integrity Because it is generally point-to-point, data corruption is less likely. More prone to data integrity issues due to networking, increasing the risk of safety-related failures. Human Error Less prone to configuration errors affecting safety, due to its simplicity. Greater chance for human errors during configuration or maintenance, affecting system safety. Emergency Situations Often the preferred choice for safety-critical systems like emergency shutdowns due to quick response time. Typically not used for immediate action tasks due to possible latency and other network-related issues. Security Lower susceptibility to cyber-attacks, as they’re not generally networked. More vulnerable to cyber threats that can compromise safety, due to networking. Built-In Safety Features Safety features are often hardwired and uncomplicated, making them robust. May have built-in safety protocols, but these can be compromised by network issues. Certifications Easier to certify for safety-critical applications due to lower complexity and higher reliability. May require more extensive testing and certification due to networking and protocol complexities. The choice between Hardwired and Serial I/Os from a safety perspective often leans toward Hardwired I/Os for critical safety applications, due to their inherent reliability and immediate response capabilities. However, the overall safety of a system is not determined solely by the type of I/O used; it’s also influenced by factors like design, maintenance practices, and the competency of the operational staff.

    leikang
    Be it industrial automation or any other PLC system, every device or equipment reaches a stage after a certain period of time, where there arises a need to either change it or upgrade it.
    Upgrading and Migration

    A PLC, if served for more than 10 years for example, will reach a stage where its technical support no longer exists or the PLC is not available for replacement as it has become obsolete. In this case, you are left with two options – either to migrate to a completely new set of PLCs or upgrade the firmware and program. This difference is really important to understand, as it helps in choosing the right work for the same.
    In this post, we will learn the difference between upgrading and migrating PLC systems and understand how to implement the correct one.
    Why is Migrating or Upgrading PLC Systems Required?
    Before going into the topic, it is first of all necessary to understand why we need to do the same. Suppose you have been using an “X” PLC for almost 15 years down the line. It is not like the program will start to malfunction suddenly; it is a completely different theory and entirely depends on how the programmer has written the code. PLC Code once written executes the same way for a lifetime as it is.
    The issue starts with hardware and support. A PLC manufacturer mostly won’t keep this “X” PLC in production for such a long period of time if it is not stable or has many limitations in programming.
    Sooner, this PLC will start to become obsolete and its replacement will not be available. Even the system integrator or the PLC manufacturer itself will not be able to provide its technical support as the staff for the same will be shifted to a newer brand or its programming cable is also no longer available.
    In that case, if suddenly the PLC system fails due to some reason, then you are left with no option but to wait for a longer downtime period to end. Also, if you are still able to get this PLC from somewhere, then its cost will be super-high and out of budget.
    With the current supply chain disruptions and the recent scarcity of new industrial automation solutions and parts, it’s not feasible to estimate exactly how long it might take to source a new unit. In that case, you are left with two options – either to migrate to another brand or upgrade the existing one to a newer firmware CPU or program.
    So, it is this reason why migration and upgradation play an important role in industrial automation. Also, new solutions bring with them reduced errors, and risks, stronger technical support, service expertise, less capital investment, and efficient operation of plant.
    What is the Migration of the PLC System?
    First of all, let us understand the simpler one of the two. Migration means to completely replace an old system with a new system. This is similar to a citizen migrating from his previous city to a new city. Suppose you have an old PLC that has some hardware defects in it after it has been found 10 years old.
    Two digital inputs of the CPU have become faulty and the CPU is no longer available in the market. Also, due to some bad luck, the system integrator which provided the PLC has shut down his business or shifted to some newer brands.
    In that case, migrating means you will need to buy a PLC of some other brand. Before buying, you will need to consider factors like IO counts, IO wiring, communication port availability, programming capacity, memory capacity, speed of execution, how much it can be expanded, etc.
    Once you get through all this, you will then need to buy a new one and write a new program in it according to the manufacturer’s software. Also, you need to share the previous IO list with the new vendor, so that he will do the IO mapping in PLC accordingly and will reduce time to wire the IO’s in the electrical panel. Once done, you can replace the old PLC with the new one and use the system accordingly.
    Although new and consistent programming standards can’t be fully applied using this approach, the overall functionality remains as close to the original as possible, and the program can be improved to some extent.
    What is Upgrading of PLC Systems?
    Let us take a second case of upgrading the PLC system. You have the same PLC of the manufacturer as discussed before and its failure has occurred. Now, you find that some higher level of PLC of the same manufacturer is available, with similar coding style and IO functionalities.
    Even the vendor is available for support. Instead of changing the vendor to a newer one or completely changing the PLC brand, you will just need to upgrade your system to a newer and higher one. This new CPU will have to be either rewritten with the new coding or just plugged and played, depending on the software. An upgrade thus, requires a more comprehensive IO wiring and PLC coding to be done as we update the system.
    Also, rewriting new codes from scratch allows the programmer to eliminate the bugs he had observed in older systems and also plan for efficient and reliable logic in a simpler manner. This is a clean slate approach to upgrading a system.
    Difference between Migrating and Upgrading PLC systems
    Migration means switching to a completely new PLC manufacturer, whereas upgrading means switching to a newer CPU of the same PLC manufacturer. Migration is cheaper than upgrading, as it requires less downtime, less new hardware, less programming time, and designing infrastructure. Migration is less risky than upgrading, as you already have the program available of the older one, and you just need to copy-paste the same. Though 100% copy is not possible, functionalities can be similar in a large way due to this approach. Migration can lead to new hardware and this can take time for engineers to understand the system quickly so that then they can maintain and troubleshoot it. In this case, upgradation is much easier. Migration is less reliable and efficient than upgrading because you do not know how this new PLC will function now in spite of studying it so much. Migrating and upgrading is a tricky thing to do and requires the detailed expertise of engineers and programmers involved in it. Also, what action to take varies from system to system. Once done, it can make your task completely easier. In this way, we saw the concept of upgrading and migrating PLC systems.

    leigehong
    The possibility of controlling the Induction motor’s speed exists only with the Variable frequency drives. Basically, there are three different modes through which we can control the speed of an induction motor.
    Using a digital signal Using an analog signal of 0 to 10V / 0 to 5 V/ 4 to 20mA / 0 to 20mA, etc. Using the Modbus communication whether on RTU mode or TCP/IP mode Speed of Induction Motor
    In this post, we will use an analog input signal with a range of 0 to 20 mA to control the motor’s speed. This article shows how to control the speed of the motor using PLC’s analog output. See the below schematic to get an overview.

    To change the motor’s speed, a 0 to 20 mA analog output signal from the PLC is sent into the analog input terminal of the VFD. The speed varies from 0 to 50 Hz as the milliamperes rise from 0 to 20. In this topic, we use six unique Analog Output points of the S7 200 smart PLC to control the speed of six motors. (each motor has individual VFD as per the motor rating).
    The PLC used here is Siemens CPU ST60 of S7 200 Smart series having two analog output modules EM AQ04 coupled with it, while the VFD model is ATV310 series of Schneider Electric. Siemens HMI is communicated with CPU ST60 to vary the speed of the motors from its screen.
    Prior to the PLC logic, see the hardware configuration and connection details below:

    The above analog output modules are added to CPU ST60. Each analog input point of the VFDs will receive a 0 to 20 mA signal from various PLC analog output points.
    Now, look at the parameter details of the ATV310 VFD drive.
    401: 01 (Reference Channel 1) 204.0: 0A (AI1 type) 204.1: 4mA (AI1 current scaling parameter of 0%) 204.2: 20mA (AI1 current scaling parameter of 100%) Apart from these, motor parameters need to be set in group no “300” according to the Motor rating.
    The analog output module is also called the DA module or digital to analog module. According to this statement, a digital value is translated to milliamperes or voltage in accordance with the configuration setup.
    Different PLCs have various digital values that can be converted into an analog voltage or milliampere signal. The Siemens S7 200 series uses 0 for 0 milliamps and 27648 for 20 milliamps.
    In accordance with parameter number “204.1,” we must determine the digital value at which the output point emits around 4mA. By using the hit-and-miss method, we identified the value as “5559,” at which we received 4 milliamperes approximately.
    According to the discussion above, the frequency would be anywhere between 0 and 50Hz, and the milliamperes in the PLC are represented as digital values. When a particular frequency is fed from HMI, some scaling is required to get the actual frequency.
    So, we can call these digital values as “unscaled” values. Now to change these unscaled values to scaled ones, there is a formula below:

    OSH = 27648.0 (Unscaled digital value to output 20 mA analog signal)
    OSL = 5559.0 (Unscaled digital value to output 4 mA analog signal)
    ISL = 0 (Lower limit of the frequency output in Hz)
    ISH = 50 (Upper limit of the frequency output in Hz)
    “Input” is the variable for setting the motor’s speed from HMI.
    “Output” is the scaled digital value
    Now, putting these values in the formula and evaluating further:
    Output = [(27648.0 – 5559.0) *(Input – 0)/ (50 – 0)] + 5559.0
    Output = [22089.0*Input /50] + 5559.0
    Output = [441.78*Input] + 5559.0
    Before evaluating the equation in the ladder logic, go through the Analog output configuration settings in the PLC software below:
    In Step 7 MicroWin Smart software, Click on the highlighted System Block settings option available in the “project tree” bar.

    In the system block settings, configure all the channels of the first AQ04 card and the 3rd & 4th channels of the second AQ04 card with the current type as highlighted.

    PLC Programming for Induction Motor Speed Control using Analog Output
    Network 1:
    VD200 stores the input value or variable value that is set from HMI in the form of frequency or Hz. It is then multiplied with 441.78 and stored in VD204.
    The value in VD204 is then added with 5559 and stored in VD208.

    The value in VD208 is an evaluated scaled output value in real format. The fractional part of the value in VD208 is discarded and the whole number portion is stored in VD276 in the double integer format using the “TRUNC” instruction.
    After that, MW4 stores this double integer value in integer format. The address for the first channel of the AQ04 module, AQW16, is where this value is now transferred.

    Ex: If VD200 = 41.5 Hz fed from HMI then VD208 = [441.78*41.5] + 5559.0 = 23892.87.
    Thus, to attain 41.5 Hz, 23892 is to be stored in MW4 in the form of integer.
    As per the network comment, the first channel is used to vary the speed of the motor (Loader) in one of the applications.
    Similarly, networks 2 to 6 are build to vary the speed of other motors and fans from their respective channels of EQ04 modules using VD212, VD224, VD236, VD248, and VD260 as their variable speed set points.

    According to the wiring connections, the second EQ04 module uses the third and fourth channels; as a result, the addresses used are AQW36 and AQW38. To learn more, see System block configuration.

    leizuofa
    Best practices in PLC wiring (Programmable Logic Controller) are essential for several reasons in industrial automation and control systems.
    In the areas of production operations, manufacturing, and energy production, as well as in a wide range of industrial sectors, major components of PLCs help to regulate and monitor different processes.
    Best Practices of PLC Wiring

    Image Courtesy: Yeulian
    Here are some key reasons why proper PLC wiring is important. In short, it provides Reliability, Safety, Accuracy, Maintenance, Scalability, Compliance, Cost efficiency, and Documentation.
    What are the Practices adopted for PLC Wiring?
    The wiring of a PLC (Programmable Logic Controller) is a fundamental part of the installation and commissioning of automated control systems. PLCs are used to control various industrial processes and machines.
    The wiring connects the PLC to sensors, actuators, and other devices on the factory floor. It ensures the signals are accurately transmitted from the PLC, allowing it to interact with the equipment.
    Here are some important practices to adopt when wiring a PLC:
    Planning
    Before beginning wiring, it is essential to have a clear plan of the layout. It should comprise components, input/output (I/O) devices, and the location of the PLC in the cabinet or electrical panel.
    Wiring Drawing
    Make sure that, have an updated (revised) copy of the electrical diagram.
    Selecting appropriate Cables
    Use quality cables that meet the necessary electrical specifications. Make sure they are long enough and have adequate current capacity to avoid signal transmission problems and overheating.
    Identification
    Clearly label all cables, connectors, and terminals. It simplifies troubleshooting, maintenance, and future expansion. Labeling makes it easy to identify each cable, connector, and terminal within the system.
    Labeling helps maintain the integrity of the control system. Mistakenly connecting cables or terminals can lead to equipment damage, system malfunction, or even safety risks. Proper identification reduces the chances of errors during installation or maintenance.
    Solid Connections
    Ensure secure and safe connections by tightening the terminals to prevent loose connections that may lead to failures.
    In industrial plants, downtown can be extremely costly. Loose connections cause unexpected equipment shutdowns or malfunctions, resulting in production delays and financial losses.
    Power and Signal Separation
    Maintain adequate separation between power cables and signal cables to avoid electromagnetic interference.
    Use gutters or dividers to physically separate the cables, if necessary. This can help to prevent cross-talk and reduce the chances of interference.
    Testing and Verification
    Before energizing the PLC system, performing continuity and verification tests is essential. This is to ensure all components are connected correctly and as per the design specifications. Incorrect connections can lead to malfunctions, inefficiencies, or damage to the equipment.   
    Safety
    Follow electrical safety regulations when wiring. Make sure the PLC and all components are unplugged before working on the wiring.
    Documentation
    Keep detailed records of all wiring, including up-to-date diagrams, wire lists, and configuration documentation. This will be valuable for future maintenance and future system modifications.
    Training
    Ensure that personnel who operate and maintain the system are trained in PLC wiring and operation.
    Regulatory Compliance
    Verify that PLC wiring complies with applicable standards.
    Proper wiring is essential to ensure the reliable and safe operation of the system controlled by the PLC.
    PLC wiring is crucial for an industrial control system’s reliability, safety, accuracy, and maintainability.
    Proper wiring ensures that the control system functions as intended and complies with industry standards and regulations, ultimately contributing to the overall efficiency and success of the industrial process.
    Why Proper PLC Wiring is Important?
    Proper wiring of a PLC (Programmable Logic Controller) is essential in industrial automation and process control systems for several important reasons:
    Proper wiring provides system reliability. Proper wiring ensures a strong and stable cable connection between system components, reducing the likelihood of intermittent failures or communication errors.
    It ensures safety. Incorrect wiring can cause short circuits, overloads, and electrical hazards. Proper wiring minimizes the possibility of electrical accidents and ensures that the system meets safety standards.
    It improves system performance: Incorrect wiring can negatively impact system performance, causing delays in communication and instruction execution. Proper cabling ensures fast and accurate data transmission.
    Proper wiring reduces downtime and maintenance costs. It helps us to carry out simpler maintenance: careful organization and labeling of cables will make it easier to identify and resolve system problems.  
    Regulatory Compliance: In many industries, some specific regulations and standards require proper wiring to ensure system safety and quality.
    PLC Wiring Tips
    Here we shared the main points related to the PLC wiring.
    Follow national and local electrical codes. Use shielded cables for analog and communication signals. Ensure proper grounding of all components. Label all wires and terminals. Implement a wire color-coding scheme. Separate input wiring from output wiring. Use the shortest possible cable lengths. Avoid looping wires around terminal screws. Select appropriate wire gauges for load and current requirements. Use wire ferrules for stranded wires. Physically separate high-voltage and low-voltage wires. Double-check polarity for power supply and I/O connections. Bundle wires neatly and use cable ties. Test for wire continuity and correct connections before powering up. Maintain updated and detailed documentation. Utilize terminal blocks for easier maintenance. Perform regular wiring inspections. Use strain relief mechanisms to protect wires. Follow lockout/tagout procedures for safety. Conduct thorough system testing after the wiring is complete.

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