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

    PLC, DCS, HMI and SCADA product application technical articles

    leizuofa
    Whenever a new PLC programmer goes to the site to commission a project, the very first question that arises is how to do it. This is because the PLC system is vast and complex to understand.
    So, every PLC programmer must know what to do when he goes to the site with proper planning. With such a large number of electrical field wires and devices, it is necessary to understand what he is doing along with the PLC program logic.
    In this post, we will learn the commissioning steps to be followed by a PLC programmer.
    Site Commissioning Steps for PLC Programmers

    The very first step for a PLC programmer is to check whether he has all the prerequisite PLC software installed on his laptop. Suppose the site has automation of Schneider in the system. Then, first, he needs to install all the corresponding PLC software on his laptop. The software must open correctly every time and all it’s related drivers must also respond properly. After that, he needs to connect his laptop to the automation hardware in his office. This will ensure that he is properly able to upload and download in the system. Improper software installation or connectivity can lead to errors in commissioning at the site.
    Then, he has to take the final backup on his laptop and check the PLC logic with the simulation. This will ensure that he goes to the site understanding the whole process. After this, carry all the communication cables along with you and get ready to go to the site. If it is found that due to time constraints, the system is not being checked fully, then note down the pending points and logic bugs observed during testing. Ensure that this is checked when commissioning.
    Once he reaches the site, first take an overall lookout for the plant condition. How much mechanical work is pending, how much electrical work is pending; that matters the most. Also, check the condition of utilities like water, air, and steam. Note down all the statuses and make a daily activities list on your laptop. Share this file with your immediate senior so that he knows where the activity is stuck and can push the corresponding person accordingly to get the work done.
    Once the panel has been given for testing, start checking the field IOs. As per the IO list and wiring diagram, the corresponding field device must operate accordingly. Note down any issues found and contact the electrical person to resolve them.
    If there are communication devices in the PLC system, you must also check them. All the communication devices must be able to properly communicate in the network bus with the PLC automation system.
    Once the field wiring has been verified, it must be checked whether all the mechanical devices are operating according to the wiring or not. Eventually, process running is important and if the device is not responding, then the process will not run properly.
    Once all the device verification part has been done, the next step is to verify the logic with the process engineer. It must be checked whether the plant is running according to the logic written or not. If there are issues found, check whether they can be resolved by logic or if it has to be resolved by the process engineer. Come to a conclusion and resolve the same.
    This completes your PLC commissioning activity. Save all the final backups and hand them over to your senior for safety. Also, note down all the final process parameters and record a video of the running plant for understanding. Make the final report and get it signed by the customer for proof that commissioning has been done. Note down any of his remarks and see that it is resolved as early as possible.
    PLC Commissioning Steps
    The main PLC commissioning steps are mentioned below with brief details.
    Review Documentation: Check system requirements and schematics. Safety Checks: Verify lockout/tagout and other safety protocols. Hardware Check: Inspect PLC and I/O modules for any damage. Power-Up: Turn on PLC and confirm basic functions. Establish Communication: Set up links between PLC and the programming terminal. Update Firmware: Install the latest PLC software version if needed. Configure I/O: Set up input and output modules. Load Program: Download the initial PLC code into the system. Test Modes: Validate individual inputs, outputs, and communication. Loop Checks: Ensure signal integrity between field devices and PLC. Logic Testing: Verify PLC functions and sequences. Simulation: Test complex logic using simulated inputs. Process Start-Up: Begin the initial test run of the process. Fine-tuning: Adjust PID controller tuning, timers, counters, and setpoints based on test runs. Update Documentation: Record changes made during commissioning. Functional Tests: Validate that the whole system works as expected. Operator Training: Teach operators how to use the new setup. Create Backup: Save the final PLC program and configuration parameters. Client Approval: Get sign-off from the client or project manager. Handover: Finalize documentation for system handover. In this way, we saw the commissioning steps to be followed by the PLC programmer.

    xiangjinjiao
    In industrial automation, there are situations where IO instruments are located very far away from the panel and it cannot be interfaced with the local PLC due to the distance involved.
    For this reason, remote IO modules are available which just communicate the data of these IOs with the main PLC. This makes communication easier as well as provides flexibility for instrument engineers to place the instrument anywhere required.
    Remote IO Adapter Module
    The communication between the remote adapter and the main PLC is mostly done through Ethernet, which is the fastest and the most efficient mode of communication.
    Such remote IO modules are available in many PLC brands. Out of that, Schneider Electric is such a brand and in that, a BMXCRA or BMECRA module is available for use. In this post, we will see the concept of CRA modules in Schneider PLC.
    CRA Module in Schneider PLC

    Image: BMXCRA31210, Modicon X80 RIO Module
    CRA is a remote IO adapter module in the Schneider PLC automation range. It does not have any CPU for writing logic; it is just a data communicator. It takes IO values and updates them to the main CPU continuously. The module works on Ethernet IP protocol. It has three LAN ports for working.
    Apart from standard IO values, the module also provides various types of diagnostics for troubleshooting. This helps the programmers in writing the logic more flexibly. For example, you have three IO modules at a very fast distance from the CPU. Then, just configure these three modules in the CRA module in the software; and the CRA will then use it for data communication with the CPU.
    Module Configuration
    The module has two rotary switches on it. They define the ID of the module. For example, there are 4 CRA modules used in the system. All four are located at far distances from each other. Then, each module must be given a separate identity so that it can be distinguished easily by the CPU logic.
    Also, the module IP is set in the CPU program. There is no configuration in the CRA module. Just properly configure the IP addresses in the PLC logic for the CRA modules, set the ID by rotary switches, and your CRA modules will start functioning accordingly.
    The module has four LEDs in it for troubleshooting – Run, IO, Module status, and Network status. Read the catalog of the module in detail for proper description.
    Schneider PLC Communication Module
    The module is supported only in M580 and Quantum range of Schneider PLC’s. One interesting thing about this module is that it has a large number of communication services like SNMP agent, SNTP client, FDR client, FTP client, TFTP client, DHCP client, CIP explicit messages, and Quality of Service. All these are a part of cybersecurity features and help in protecting the module from cyberattacks.
    The CRA modules are completely redundant. It depends on how you network the system. The level of redundancy depends on how you cable the wires and how you decide the topology. Based on that, you can safely operate the logic without the fear of IO data loss.
    For example, you have two CRA modules and want IO redundancy. Based on the topology it supports, you can design the network in such a way that if one LAN port of the first CRA module fails, then you can take data via the second LAN port to the second CRA module and then to the main PLC. Various routing options are available.
    In this way, we saw the concept of the CRA module in Schneider PLC.

    xiangjinjiao
    In any PLC, it is important to understand how its instructions have been written. The basic understanding is the same in all the languages; the difference is how it is illustrated. If we are clear with the instructions, then we can work with any type of PLC software.
    One of the most widely used brands in automation is Rockwell. There are many different types of instructions in it for programming. In that, there are two instructions that are mostly required in any PLC logic. They are – One-shot rising edge and one-shot falling edge. In this post, we will see the working of these two instructions.
    One Shot Rising Edge (OSR)
    In PLC programming, you must have heard two common types of objects – positive peak and negative peak. A positive peak means that it takes a trigger only when the variable changes from 0 to 1. The output of this object comes in a trigger pulse type.
    Now, instead of the variable state, there is one additional instruction in PLCs where you get the trigger output of the whole rung. This means, that when the whole rung or condition changes its state from 0 to 1, then the output will come in a pulse-type trigger condition. This is rising trigger instruction in PLC. In Rockwell PLC, it is called one-shot rising edge instruction.
    Refer to the below image for understanding. As you can see, the instruction takes two inputs in its condition. Both are written as NO logic; meaning when both are on, then only the condition is true. Now, when this happens, the instruction has two variables in it – storage bit and output bit. The function of the storage bit is to store the condition state.
    When both the bits turn on and the condition changes from 0 to 1, then the storage bit gets updated as 1 and passes on this value to the output bit. The output bit turns on for a very short duration of time, in milliseconds. This pulse output can then be used by the PLC programmer in his logic.
    As long as the condition is true, the storage bit does not change. As soon as the condition becomes false, the storage bit is updated with 0. When again the condition becomes true, then the output bit turns on as a pulse.

    This shows that this instruction is very useful when you want to turn an output by only a pulse, and this pulse must be generated only when the whole condition is true, and not when a single variable becomes true.
    One Shot Falling Edge (OSF)
    Now, take an example where it is required to take action when the system is stopped. This means, that when the condition becomes false from true, then some action must be taken. And the action must be done in a trigger type; it should not be continuously on. This is called a negative peak. To execute this function, either a negative peak must be taken from the variable or the negative peak must be taken from the whole condition as discussed earlier. For the second type, one-shot falling edge instruction is used in Rockwell PLC.
    Refer to the above image. There are 2 NO conditions in the rung, and the output of this rung is connected to the OSF block. The block has two bits – storage and output. The storage bit is used to store the condition of the rung.
    When the condition becomes true, then the storage bit is updated to 1. When the condition becomes false from true, then the storage bit is updated to 0 and the output bit becomes 1 in a pulse form. The cycle repeats again when the condition becomes true once again. The output bit is in pulse form and is on for a very short time, in milliseconds.
    This shows that this instruction is very useful when you want to turn an output by only a pulse, and this pulse must be generated only when the whole condition is false, and not when a single variable becomes false.
    In this way, we saw the one-shot rising edge and one-shot falling edge instructions in Rockwell PLC.

    caixiaofeng
    In previous articles, we introduced the concept of distributed IO modules, and how to configure an IO module with a PLC. In this article, we will show how to do Distributed IO Sharing Between PLC Systems.
    Contents:
    Problem description. Sharing the IO device with two PLCs. Assigning different internal modules to PLCs. Problem description
    In the previous article, we showed how we can connect and configure a distributed IO module with a PLC and control the IO points of the Distributed module through that PLC. In this article, we discuss the case when we need to use the same distributed IO module with two different PLCs. See picture 1.

    Picture 1. Two different PLC projects.
    Distributed IO Sharing Between PLC Systems
    Imagine that we need to share the inputs and outputs points of the distributed module between the two PLCs. Sharing a distributed IO module between two PLCs is possible but not all modules can do that, but most modern ones can.
    Another way to share the information would be to get all the information from the distributed IO to one PLC and establish communication between the two PLCs and then exchange the needed data. This will be shown in another article.
    In the distributed IO device (IO device_1) we have configured many IO modules such as 4DIx24VDC module, 8DOx24VDC module, 2DIx24VDC module, and some more modules. See picture 2.

    picture 2. Different IO modules in our IO device.
    Sharing the IO device with two PLCs
    In this article, we will assume as you see from the picture that we want to control the 4DIx24VDC module and 8DOx24VDC module through PLC_1 and I want to control the 2DIx24VDC module and, 2DOx24VDC module from PLC_2.
    So I want to share the different modules between the two PLCs, hence the name-sharing devices.
    As you can see in picture 1, the distributed IO device (IO device_1) is already an extension of PLC_1 as we set that up in the previous article, but we also need to make it an extension of PLC_2 so it can be shared between the two PLCs. See picture 3.

    picture 3. IO device is an extension of PLC_1
    Usually, when doing that we would have each PLC on a different TIA Portal project, but as we don’t have real hardware devices, we will just use one TIA Portal software project to show how to share the distributed IO module between the two PLCs.
    We have one project with two PLCs. And we need to assign the IO device_1to the PLC_1 and PLC_2
    To do that, copy the module in the Network view and paste it to have two modules in your project. See picture 4.

    picture 4. Copy and paste the IO device.
    Now, we need to assign this IO device to the PLC_2, as we did with PLC_1 in the last article. See picture 5.

    picture 5. Assign the module to PLC_2
    NOW, if you try to download your project to both PLCs, the PLC_1 will be able to find the IO module. However, PLC_2 will not be able to find the IO module because there is no actual hardware module that is named IO device_2, we have only one hardware IO device and from last article it was configured with the name IO device_1 that is why the PLC_2 will not find the IO device. See picture 6.

    picture 6. Connection is made through Device Network Name.
    So, we need to give the same device network name to both IO modules, see picture 7.

    picture 7. Network device name
    As you can see, the Network Device Name for the IO module is IO device_1, see picture 8 for the other IO module.

    picture 8. Network Device Name for the 2nd IO module.
    Here, the network name is IO device_2. We need to give both IO modules the same name so both PLCs can find it and connect to it.
    Unclick the automatic name generation option so we can change the name and make both of them IO device_1, also make sure that all information inside the red area is the same in both modules. See picture 9.

    picture 9. Unclick the automatic generation option.
    Check pictures 10a and 10b after we changed the information to be the same for both modules.

    Picture 10a. 2nd IO module.

    Picture 10b. 1st IO module
    Now that the two IO modules are identical, both PLCs can find and communicate with the IO module. See picture 11.

    picture 11. Both PLCs can find the IO module.
    Up until this point, we were assuming that both PLCs are within the same TIA Portal project.
    But, in case we are sharing the IO module with a controller in another TIA Portal project, we will do the same as before but we will add an extra step.
    In this step, we will go to the properties of the IO module and change the shared device IO cycle option as you see in picture 12.

    picture 12. IO controller outside the project
    As you can see from the picture, if the two PLCs are of different TIA Portal projects, we will change the value inside the red box to 1.
    As we have both PLCs in the same project we will keep it zero.
    Now that both PLCs can see and communicate with the IO device, we need to tell the IO module, which internal modules should communicate with which PLC.
    As we mentioned in picture 2, we need a 4DIx24VDC module and 8DOx24VDC module to communicate withPLC_1 and I want to control the 2DIx24VDC module and 2DOx24VDC module from PLC_2.
    We can do that by following the following steps.
    Assigning different internal modules to PLCs
    Start by going to the properties of the IO device_1, you will find that all internal modules of the IO device belong to PLC_1. See picture 13.

    picture 13. Shared device of the IO module.
    As you can see from the picture, accessing all internal modules of the IO device is assigned to PLC_1, but as we mentioned before we need the last two internal modules 2DIx24VDC module and 2DOx24VDC module to be accessed by PLC_2.
    To do so, just right-click the module you want and unselect the PLC_1 option, and make it blank to indicate that this module will be controlled through a different controller. See picture 14.

    picture 14. Unselect internal modules.
    If you check the device overview of the IO device_1 after you unselect the PLC_1 option, you will see that those internal modules have no addressing assigned with the PLC_1 indicating they belong somewhere else. See picture 15.

    picture 15. No addressing for modules not assigned to PLC_1
    NOW, I need to assign those two modules to the IO device_2 for PLC_2.
    By doing the same steps as before, go to the shared device properties of the  , and assign only the two needed modules with PLC_2. See picture 16.

    picture 16. Assign needed modules to PLC_2
    Now that the 2DIx24VDC module and 2DOx24VDC module are assigned to PLC_2, if you check the device overview you will find their addressing with PLC_2 as we want. See picture 17.

    picture 17. Addressing belong to PLC_2
    That is how we can share one IO module between two PLCs, whether they are in the same TIA Portal project or in two different projects.

    leizuofa
    In this article, we will discuss yet another way of communicating between two PLCs, whether they are in the same project or two different PLC projects. In this article, we will talk about the PUT command in Siemens PLC which can be used to send or put data from one PLC into a second PLC.
    What is the PUT Command?
    In general, the PUT command is a TIA Portal built-in function block FB that is used exclusively for S7-Family CPUs to put data from a local PLC to a remote partner PLC.
    When using the PUT command, I would have two PLCs, where I need to send data from one PLC called local to another PLC called partner.
    Some configurations must be done to the partner PLC, to enable it to be accessed by the other PLC. In addition to a Profinet connection between the PLCs.
    We will create a sample project to show how to use the PUT command.
    PUT Command in Siemens PLC
    We will assume a sample project where we have two PLCs in the same project, PLC_1 which will act as the local PLC and PLC_2 which is the partner PLC.
    We want to write an integer from the local to the partner PLC.
    Sample PLC project
    First, let’s create a new project and add the two PLCs. See picture 1.

    picture 1. Add the local and partner PLCs.
    What I need now is to configure PLC_2, the one that will receive the data to be able to receive this data. And PLC_1 will be used with the PUT command.
    The 1st thing I need to do is allow the access of the PUT command to the PLC_2 that will receive the data. See picture 2.

    picture 2. Allow PUT command access.
    As you see from the picture, we allow the PUT command to access the PLC_2 from the Properties of the PLC_2, in the Protection and Security option, click on the
    “Permit access with PUT/GET communication from the remote partner”
    Now, I am allowed to put data from any remote partner to PLC_2 using the PUT command.
    The 2nd thing is to prepare a space or memory in PLC_2 to the data that will be put in it. We will assume that we want to PUT an integer value into that PLC, so I will prepare a memory according to that. See picture 3.

    picture 3. Prepare area to receive data.
    And that is it; this is the entire configuration you need to prepare from the PLC_2 side to be able to receive data through PUT command.
    Next, we set up the data being sent from the PLC_1. We will create a data block to hold the data sent to PLC_2 and inside this data block, we will define an integer tag to be PUT into PLC_2. See picture 4.

    picture 4. Create a data block to hold the sent data.
    We defined an integer tag “SendMeToPLC_2” that we want to send to PLC_2. See picture 5.

    picture 5. Define the data to be sent.
    Note that, for PLC_1, we don’t need to allow the access with PUT command option. We activate this feature in the PLC that will receive data, not the PLC that will send it.
    Now, let’s use the PUT command in our programming, in the main OB1 we will drag and drop the PUT command FB. See picture 6.

    picture 6. Add the PUT command to OB1.
    Note that, the PUT command is found in the S7 communication folder, as it is an exclusive function for S7 family PLC, because it involves safety issues. Remember in picture 2 when we allowed the use of PUT command it was in the Security and Protection attribute of the PLC properties as it is related to PLC safety and protection.
    The PUT command is essentially a function block, so when adding it to my logic I will be asked to create a data instance. See picture 7.

    picture 7. Create a data instance for the PUT command.
    After you press OK, the PUT command is now added to your PLC logic. See picture 8.

    picture 8. PUT command
    After we added the PUT command, now we need to configure it, we have two parameters to configure for the PUT command.
    The connection between PLCs The block that will be PUT from PLC_1 to PLC_2 To go to the configuration view of the PUT command, press the small blue icon shown in last picture.
    In the connection parameter, you will set the communication between the local (PLC_1) and partner (PLC_2) PLCs. See picture 9.

    picture 9. Connection parameter.
    As you can see, the Local PLC is set to PLC_1 which is the PLC where the PUT command is used. The partner side is still empty and that is where we should assign PLC_2.
    If you click on the drop-down list you will have two options for a partner. See picture 10.

    picture 10. Partner connection
    The partner is the PLC that will receive the data; you will find that you have two options to select from:
    PLC_2 [CPU 1516-3 PN/DP] Unspecified Because both PLCs are in the same project, when I choose the PLC_2 option, all connection parameters will be automatically filled in. see picture 11.

    picture 11. PLC_2 as a partner
    On the other hand, if the partner PLC is from a different project, then I will choose the Unspecified option, and in that case, I will have to fill in some data such as the Partner PLC’s IP address. See picture 12.

    picture 12. Unspecified Partner
    As you can see, in that case, I need to fill in some data, such as the IP address and also I need to add a subnet for PLC_1.
    To add a subnet for PLC_1 we will go to Profinet properties of the PLC_1 and select add subnet option. See picture 13.

    picture 13. Add subnet.
    Once that is done, the connection parameter configuration will be done. See picture 14.
    The connection name should be Unique for each PUT command you make, TIA Portal will automatically give it a new name, but it is maybe better for you to assign a more proper name for the connection in your project. We here kept it as it is.

    picture 14. Connection parameter is done
    The next step in the PUT command configuration is the Block parameter setup.
    In these parameters we specify the trigger for the PUT command, meaning what signal will start the PUT command action. And also what data will be put from PLC_1 and where will it be stored in the PLC_2. See picture 15.

    picture 15. Block parameter setup
    For the Start Request (REQ) signal we have defined an input tag (SendData %I0.0). And as we mentioned before we have already defined the tag that will be send to PLC_2 and where it will be stored inside the PLC.
    Completing the block parameter configuration will conclude the configuration of the PUT command. See picture 16.

    picture 16. Calling of a PUT command
    So, in summary, when the REQ signal is triggered, the data in SD_1 will be sent to ADDR_1.

    leigehong
    In previous articles we started to discuss the different ways of communicating between two or more PLCs, so far we talked about the I-device feature as well as the PUT and GET commands which were methods exclusively for Siemens PLCs.
    Communicating Between Siemens PLC and Other PLC
    In this article we will discuss another way of connecting two PLCs together, this way has more advantages than the PUT and GET commands we discussed before, because opposite to the PUT/GET commands that were exclusive to the S7 family. This new method is an open user communication meaning we can use it to communicate between an SIEMENS PLC and any other brand of PLC, it doesn’t even need to be two PLCs, this method can communicate between PLC and any other device that can understand TCP network protocol such as PCs, servers, printers, etc.
    In this article, we will show how to setup a communication between two PLCs using the TCON and TDISCON blocks and in the next article, we will show how to move data between the PLCs after setting up the connection.
    Open user communication blocks TCON and TDISCON
    We use the TCON block to set up and establish a communication connection between two PLCs. Once the connection has been set up and established, it is automatically maintained by the PLC.
    Both communication partners call the TCON instruction to set up and establish the communication connection. That means I have to call the TCON block in both PLCs and we have to configure the block in both PLCs as we will see in the sample project.
    During block configuration, we will specify which partner is the active communication end point and which is the passive one. That means which PLC will try to connect and which one will open a communication port and be waiting for the other one.
    An  existing  connection  is  terminated  and  the  connection  set  up  is  removed  when  the TDISCON block is executed or when the CPU changes to STOP mode. To set up and establish the connection again, you will need to execute TCON again.
    Sample PLC Project using TCON
    As we explained before in previous articles, to setup a communication between two PLCs we have to establish two things:
    Communication between the PLCs. Data transfer between the two PLCs. In this article, we will set up an open user communication with TCP protocol between two PLCs using the TCON block. In the next article, we will show how to move data after the connection is done.
    First, let’s create a new project and add our two PLCs. We will add the CPU1516-3PN/DP PLC and we will name them PLC_1 and PLC_2, and the objective is to set up a connection between them. See picture 1.

    picture 1. Add PLC_1 and PLC_2.
    Now, we will simply just add the TCON block into our PLC logic, as we mentioned before we need to call the TCON for both PLCs, let’s start with PLC_1.
    Simply drag and drop the TCON block which you will find in the open user communication folder. See picture 2.

    picture 2. Drag and drop the TCON instruction
    The TCON block is essentially a function block, so when adding it to my main OB1, we will be asked to create a data block instance to that block.
    Create the data instance and give it a proper name. See picture 3.

    picture 3. Create data instance.
    Now, the TCON block is added to your logic, we need to configure the connection parameter for the block.
    Just press on the small blue configuration icon above the block. See picture 4.

    picture 4. Open configuration view
    When you press the blue icon you will open the configuration view for the TCON block where we can set up the connection parameter.
    You will find it pretty much just like the connection parameter of the PUT and GET commands. See picture 5.

    picture 5. Connection parameter of TCON.
    The Partner PLC options in the TCON block have more options than that of the PUT/GET commands as we are using open user communication. See picture 6.

    picture 6. Partner PLC options
    As you can see from the picture, we have 4 different options, and they are:
    PLC_2: in case both PLCs are in the same project, the PLC_2 will be shown here Broadcast: this will make the connection available to any device on the network Multicast: this will make the connection with selected devices, more than one device but not all of them Unspecified: if the PLC is in another TIA Portal project. When choosing the unspecified option, we will be asked to add the IP address of the PLC and also we need to add new connection data. See picture 7.

    picture 7.  Add new connection data
    As you can see in the picture, to create a new connection data, just click the drop-down arrow and press new. This will create a new connection data block and it will automatically be assigned to the TCON block, see picture 8.

    picture 8. Connection data block is created.
    As you can see a connection data block was created, now I need to add the IP address of the Partner PLC.
    Another thing we need to do is to choose which PLC will be the active connection establishment. This will decide which PLC will be responsible for establishing the connection while the other one in that case will be only responsible for opening a connection port. See picture 9.

    picture 9. Assign PLC_1 as active connection establishment.
    As we choose the PLC_1 to be the active connection establishment, then PLC_2 will be responsible for opening a connection port, and I have to choose a value for that port. It can be any value, but it is automatically assigned in TIA Portal as 2000 so we will keep as it is. See picture 10.

    Picture 10. Partner port.
    You can see in the previous picture that the connection parameter has turned green, indicating that all configurations are done and accepted.
    When using TCON to establish a connection between two PLCs, both PLCs must call the TCON instruction to establish the connection, so we need now to do the same with the other PLC_2. Add the TCON block into the main OB1 of PLC_2, see picture 11.

    picture 11. Call TCON in PLC_2.
    After adding the TCON block, we need to configure the connection parameter as we did with PLC_1. See picture 12.

    Picture  12. Connection parameter of PLC_2
    You can see from the picture that we still choose the PLC_1 as the active connection establishment, and we still kept the port of the PLC_2 to be 2000.
    The active connection establishment and the port must be the same for both PLCs configuration or the connection will fail. Now, the connection configuration for both PLCs is done, see picture 13.

    picture 13. TCON block in both PLCs.
    As we see from the picture, we need one more thing, which is to define the REQ for both PLCs.
    We created AllowConnection for PLC_2 and StartConnection for PLC_1. See picture 14.

    picture 14. Define the REQ signals.
    The connection between two PLCs is now done, and it goes as follows:
    PLC_1 will try to establish a connection with PLC_2 when the REQ signal is active, but it can’t do that until PLC_2 enable the connection capability and that will be done when the TCON block of PLC_1 receive a signal at REQ.
    A REQ signal is active for TCON of PLC_2 to enable the connection ( this means PLC_2 will open Port 2000 waiting for connection) A REQ signal active for TCON of PLC_1 to start connection (this will allow PLC_1 to establish a connection with PLC_2 through port 2000) PROJECT SIMULATION
    Let’s compile our project and start a simulation to see how the connection will be established.
    To see the connection of any PLC and also between the PLCs, can open the network view and open the connections tab to see all active and established connections. See picture 15.

    picture 15. PLC_2 is waiting for connection.
    When the REQ is True, PLC_2 will be open for connection, you can see the STATUS value is 7002 _ if you check the help of the TCON block the status 7002 means waiting for connection_. You can also see in the picture from the network view that PLC_2 is waiting for a connection.
    When the REQ of PLC_1 TCON block is true, PLC_1 will try to establish a connection with PLC_2, and because PLC_2 is already open and waiting for connection, the PLC_1 will be able to find and establish a connection with PLC_2. See picture 16.

    Picture 16. PLC_1 establishing a connection.
    Notice, that all connection in the network view are now green, indicating healthy and ongoing connection between PLC_1 and PLC_2.
    As we mentioned before once the connection has been set up and established, it is automatically maintained. So, even when the REQ signals turn false the connection between the two PLC will remain. See picture 17.

    Picture 17. Connection still ongoing.
    But, if turning the REQ signals doesn’t disconnect the connection, how can I disconnect if I want to?
    Disconnection block TDISCON
    To disconnect the connection between the two PLCs, we can put the PLC into STOP mode which is not practical during running the process. And we also can use the disconnection block or TDISCON.
    To add a TDISCON block, just drag and drop it into your logic, see picture 18.

    picture 18. Add TDISCON block
    as you can see adding TDISCON block will need a data block instance, once the block is added into your logic, all you need to do is to assign the Connection ID that you need to disconnect and also you need to assign an REQ signal to will start the connection termination. See picture 19.

    picture 19. TDISCON block.
    NOW, let’s add a TDISCON block in the other PLC, so we would have the ability of disconnecting the connection. See picture 20. For TDISCON block of PLC_1.

    Picture 20. TDISCON in PLC_1
    Let’s go back to the simulation and see how to use TDISCON blocks, see picture 21.

    picture 21. Connection still active.
    As you can see from the picture, the connection between the PLCs are still active with the REQ signals of the TDISCON still false.
    If the REQ of PLC_1 turn TRUE, the connection will be terminated, but you will notice that PLC_2 still waiting for connection, see picture 22.

    picture 22. REQ of PLC_1 is true.
    When the REQ for PLC_2 TDISCON block is true,  PLC_2 will no longer be waiting for connection. See picture 23.

    picture 23. Connection is terminated.
    We showed in this article how to establish a connection between two PLCs using the TCON and TDISCON blocks.

    leigehong
    In the previous article, we talked about how to set up a connection between two PLCs using open user communication, and we used the TCP protocol to connect between two PLCs. We showed in the article how to use instructions like TCON and TDISCON to establish this connection.
    Moving Data between PLCs
    In this article, we will show how we can start moving DATA between the PLCs we connected last article. We will use the TSEND and TRCV blocks for this purpose.
    Send Data to PLC_2
    We will build on the project we created in the last article, which means there are already the TCON and TDISCON blocks installed into our project. and we will continue our project by adding the TSEND and TRCV blocks to start moving data between the two PLCs.
    To send data from PLC_1 into PLC_2 let’s start by creating a data block that will hold all information we need to send to PLC_2. See picture 1.

    picture 1. Create a new data block.
    As we discussed before, it is a better practice to give a proper naming to your blocks, that way it will be easy and intuitive to figure out what is each block are meant for.
    Second, let’s add some data inside the Data block which we want to send to PLC_2.
    We assumed that we need to send three different data tags. See picture 2.

    picture 2. Define some data to send to PLC_2.
    There is one more thing we need to do to be able to send the data block we just created to PLC_2 and that is to make sure the optimized block access of the Data block is not selected.
    To do that we need to go to properties of the data block and unselect that option. See pictures 3 and 4.

    picture 3. Go to properties of data block.

    picture 4. Uncheck the Optimized block access option.
    Make sure to uncheck this option before using the TSEND block, or it won’t work.
    Now that we prepared the data we want to send to the PLC_2 let’s actually attempt to send it. We will do that by using the TSEND block. Just drag and drop the instruction into your main OB1 to add it to your logic. See picture 5.

    picture 5. Add TSEND block.
    When adding the TSEND block you will be asked to create an instance data block because it is essentially a function block, again give it a proper name. See picture 6.

    Picture 6. Create data instance for the TSEND.
    When the TSEND block is added into your logic, you will find that there are some important configurations we need to make. See picture 7.

    picture 7. The TSEND block.
    As you can see, we need to make some configuration:
    The REQ signal to allow the sending of the data. As for the REQ signal, we will define a tag SendData that will be used to enable the sending of the data. 
    ID of the connection I will use to send the data, because I can have more than one connection, so I need to assign which connection will be used. In the last article, we defined the ID 1 for the connection between PLC_1 and PLC_2, so we will set the ID to 1.
    DATA that I need to send. We already created a data block with all information I need to send, we can simply just drag and drop the data block into the TSEND block. See picture 8.
    picture 8. Configure the TSEND block.
    Receive Data from PLC_1
    After we setup the TSEND for sending the data to PLC_2, we need to receive these data inside the PLC_2. To do that we will use the TRCV block. See picture 9.

    picture 9. Add TRCV block.
    As you can see, just drag and drop the TRCV block to add it into your logic. And you know that next we will need to create a data instance to that block. See picture 10.

    picture 10. Add data instance to TRCV block.
    After the TRCV block is called into your logic, we will need to configure some parameters as we did with the TSEND. See picture 11.

    picture 11. The TRCV block.
    As you can see, the EN-R is an enable signal that must be true to allow the TRCV block to start receiving the data. The ID is the connection that will be used and the DATA is where the received data will be stored.
    So, we need to create a data block to receive the data inside it. Remember to give it a proper name. See picture 12.

    picture 12. Create data block to receive data.
    Next, define the information tags that will be received from PLC_1, it is a best practice to ensure the data block hold the same data structure as the data that will be received. See picture 13.

    picture 13. Define data tags.
    For the EN-R, we will define a RecieveData tag to enable the data receive. And for the connection ID it is 1 as we set it up before. See picture 14.

    picture 14. EN-R signal.
    Next, drag and drop the data block we created into our TRCV block to finish all configurations. See picture 15.

    picture 15. Add your data block into TRCV block.
    When you drag and drop the DB we created, you will notice that TIA Portal is giving a warning and that it is not accepting the data block we just added.
    And that is because we didn’t unchecked the “Optimized block access” of the data block as we did with TSEND. See picture 16.

    picture 16. Optimized block access.
    As we said before, we have to uncheck this option otherwise the TSEND and TRCV won’t work. See picture 17.

    picture 17. Uncheck the optimized block access option.
    You can see that once we unchecked the “optimized block access” the data block is now accepted with the TRCV instruction.
    Now that the calling and configuration of the TSEND and TRCV blocks is done. Let’s simulate our project and see how the data will be sent and received.
    First we will create a simple logic that ensures that there are data values for our defined tags.
    Simple logic to automatically create data values
    We will create a simple logic to automatically create and update the data values so it will be easier to see the data transfer between the two PLCs. See picture 18.

    picture 18. Simple logic.
    This simple logic will use the clock bit %M50.5 to automatically change the values of the data stored inside SendToPLC_2 data block. 
    Simulation of the PLC project
    Let’s compile our project and start a simulation. The first thing we will need to do is to establish the connection between the two PLCs using the TCON block we configured last article.
    Remember that we will need to enable the connection capability from PLC_2 and establish the connection with PLC_1. See pictures 19, 20 and 21.

    picture 19. No connection between PLCs

    picture 20. enable the connection.

    picture 21. Establish the connection.
    Now, that we established the connection between the two PLCs let’s move the data from PLC_1 into PLC_2 as we set it up.
    First, make the SendData tag TRUE. See picture 22.

    Picture 22. REQ signal is true.
    You can see that, even though the SendData is TRUE, there were no data sent from PLC_1 to PLC_2. And that is because the TRCV block is not yet enabled to receive any data. See picture 23.

    picture23. EN-R signal is false.
    As you can see, because the RecieveData is not yet TRUE, the TRCV block is not enabled to receive any data. Once the EN-R is true the data will be sent from the data block in PLC_1 into the data block of PLC_2. See picture 24.

    picture 24. EN-R signal is True.
    Once the EN-R is true, you can see that the data is moved from PLC_1 into PLC_2.
    If you open the project and simulate it yourself, you will find the data is continuously being updated in PLC_1 and transferred into PLC_2.
    And this is how we can establish a communication between two PLCs and use TSEND, TRCV blocks.

    leikang
    Learn the PLC logic example on multiple switches and motors with the ladder diagram.
    This PLC logic example is prepared for the engineering students to learn and practice the ladder logic. The design of the same PLC program for industrial usage will be different.
    PLC Logic Example
    Problem Statement:
    Design a PLC ladder logic for the following application.
    There is a use of four toggle switches to control four motors.
    If Switch 1 is ON, then Motor I will be ON.
    If Switch 2 is ON, then Motor I and Motor II will be ON.
    If Switch 3 is ON, then Motor I, Motor II, and Motor III will be ON.
    If Switch 4 is ON, then Motor I, Motor II, Motor III, and Motor IV will be ON.
    Inputs of PLC
    The list of the digital inputs for this PLC logic is mentioned below.
    Switch 1: I0.0
    Switch 2: I0.1
    Switch 3: I0.2
    Switch 4: I0.3
    Outputs of PLC
    The required digital outputs are listed below.
    Motor 1: Q0.0
    Motor 2: Q0.1
    Motor 3: Q0.2
    Motor 4: Q0.3
    Multiple Switches and Motors Ladder Logic
    Here is the PLC logic for the given problem statement.

    Program Explained
    For this example, we used Schneider PLC software for programming.
    In the above PLC program, we have used Normal Open Contact for Switch 1 (I0.0), Switch 2 (I0.1), Switch 3 (I0.2) and Switch 4 (I0.3)
    Switch 1, Switch 2, Switch 3, and Switch 4 are connected in parallel for Motor 1, thus implementing OR logic gate.
    For Motor 2, inputs switch 2, switch 3, and switch 4 are connected in parallel, thus implementing OR logic gate.
    Switch 3 and switch 4 are implementing OR logic gate i.e., connected in parallel for Motor 3.
    Only Switch 4 is connected to Motor 4.
    For Motor 1 to be ON, either Switch 1 or Switch 2 or Switch 3 or Switch 4 should be ON.
    To turn ON Motor 2, either Switch 2 or Switch 3 or Switch 4 should be ON.
    When Switch 3 or Switch 4 is ON, then Motor 3 will turn ON.
    Motor 4 will turn ON when Switch 4 is turned ON.
    PLC Simulation Results
    Next, we will see the PLC simulation results with different input switch ON and OFF combinations.
    When Switch 1 is ON

    When the toggle switch 1 is turned ON, the current flows through it (here we are using the term “Current” in case of an electrical circuit, so here you can assume it as “Current” or simply call it as “Signal”).
    As a result, Motor 1 gets ON. Other motors will remain OFF because Switch 1 is not connected to them.
    When Switch 2 is ON

    The current will flow through switch 2 when it is turned ON that will turn ON Motor 1 and Motor 2. It is so because switch 2 is connected to Motor 1 and Motor 2 only.
    When Switch 3 is ON

    When Switch 3 is turned ON, the current flows through it that will turn ON three motors i.e., Motor 1, Motor 2 and Motor 3. The input switch 3 is connected to these outputs only. Motor 4 will remain OFF as Switch 3 is not connected to it.
    When Switch 4 is ON

    Switch 4 will turn ON all the motors when turned ON. Switch 4 is connected to all the motors, when turned ON, Motor 2, Motor 2, Motor 3 and Motor 4 will turn ON.

    caixiaofeng
    This is a PLC Program to drain the same products from two tanks. Learn the PLC programming with this simple example.
    Drain the Same Products from Two Tanks
    Problem Description
    Two tanks are filled with same products. Draining materials from these two tanks is depended on the requirement of storage tank.
    Implement logic for this system in PLC using ladder diagram.
    Problem Diagram

    PLC Example Solution
    Here two tanks are used for the system. For level measurement, two sensors are used (level low sensors). As shown in figure we use here two pumps for transferring the materials from tanks (Tank 1 & Tank 2) to storage tanks.
    Here we will use level transmitter for storage tank level measurement. PUMP 1 & PUMP 2 will be controlled by level transmitter feedback.
    Here we used two pumps for smooth operation. Both pumps will be operated when level of the storage tanks is detected below its limit.
    Note:-Here we are consider simple automation for this system. Level transmitter is used in this system and it will measure the level of the storage.
    Storage tank is taken of 500cm height for simplicity and level transmitter feedback is 4 to 20mA.
    We will use PLC S7-300 for this application. We will use scaling for programming purpose.
    List of I/Os
    List of inputs
    Cycle START:- I0.0 Cycle STOP :- I0.1 Level low of tank 1 :- I0.2 Level of tank 2 :- I0.3 List of outputs
    Pump 1 :- Q0.0 Pump 2 :- Q0.1 M memory
    Cycle ON bit :- M0.0 Analog value from the transmitter :- MW10 (INT) Analog value from the transmitter :- MD100 (DINT) Multiplication value :- MD104 Actual water level (cm) :- MD108 PLC Ladder Diagram for draining the same products from two tanks





    Program Explanation
    For this application, we used S7-300 PLC and TIA portal software for programming.
    Network 1:
    we used latching circuit for cycle ON (M0.0) output.it can be started by pressing START PB (I0.0) and stop by pressing STOP PB (I0.1).
    Network 2:
    Here actual count or value coming from the transmitter is current (4 to 20mA) so by using analog input channel in the PLC we can convert it into digital count. This digit is in INT (MW10) format so we need to convert it into DINT (MD100) for calculation or multiplication.
    Network 3:
    DINT value (MD100) is multiplied with max height (500cm) of the tank for calculation purpose.
    Network 4:
    Multiplied value (MD104) is divided by max count of the analog module (27648).And final actual height is stored in MD108.
    Network 5:
    Here we used comparator for PUMP 1 (Q0.0).During requirement of the material PUMP 3 will be operated by operator, water level height will decrease.
    So as per our automation or system we need to fill storage tank, pump 1 will be started if water level is less than its limit (here we have taken 480cm).
    Note:- PUMP 1 should be stop if level low (I0.2) of the tank 1 is detected.
    Network 6:
    Here we used comparator for PUMP 2 (Q0.1). During requirement of the material PUMP 3 will be operated by operator, water level height will decrease. So as per our automation or system we need to fill storage tank, pump 2 will be started if water level is less than its limit (here we have taken 480cm).
    Note:- PUMP 2 should be stop if level low (I0.3) of the tank 2 is detected.
    During all function cycle should be ON.
    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 drainage system, 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. Also all interlocks are not considered in the application.
    Result


    leikang
    This is a PLC Program to control the level of parallel tanks. Learn the PLC programming using this example.
    Parallel Tanks Level Control
    Problem Description
    Two tanks are connected in parallel connection. We need to heat and cool the incoming material into the tanks and simultaneously control the level of the tanks.
    Implement the PLC program for this application.
    Problem Diagram

    Problem Solution
    Heating process is used to heat the material in the tank and cooling process is used to cool the material. Here consider both material are same as show in figure, inlet valve feeds material in both the tanks.
    Here we can use level switches for detecting the low levels and high levels for both the tanks.
    Use two temperature sensors for measuring the temperature of both the tanks.
    Outlet valves are used at the bottom of the tanks to drain the materials for further process.
    We will write PLC program for this application.
    List of Inputs & Outputs
    Digital Inputs
    Cycle START :- I0.0 Cycle STOP :- I0.1 Low level tank 1(LL1) :- I0.3 Low level tank 2(LL2) :- I0.4 High level tank 1(LH1) :- I0.5 High level tank 2(LH2) :- I0.6 Digital Outputs
    Inlet valve V2 for heating tank :- Q0.0 Inlet valve V3 for cooling tank :- Q0.1 Outlet valve V4 for heating tank :- Q0.2 Outlet valve V5 for cooling tank :- Q0.3 M memory
    Cycle ON bit :- M0.0 Register for temperature of heating tank :- MD10 Register for temperature of cooling tank :- MD14 Outlet valve V5 for cooling tank :- Q0.3 PLC Program for level control of parallel tanks




    Program Explanation
    For this application we used S7-300 PLC and TIA portal software for programming. We can implement this logic by using other PLC also.
    Network 1:
    This Network is for latching circuit. Whenever START button is pressed (I0.0), Cycle ON (M0.0) bit will be ON. Cycle can be STOP by pressing STOP PB (I0.1).
    Network 2:
    When heating tank level low (I0.3) is detected, inlet valve V2 (Q0.0) will be ON. If level high of tank 1(I0.5) is not detected and START (I0.0) button is pressed, inlet valve V2 (Q0.0) will be ON.
    Network 3:
    If level low of tank 2 (I0.4) is detected, inlet valve V3 (Q0.1) will be ON. If START button is pressed and high level of tank 2 (I0.6) is not detected, inlet valve V3 (Q0.1) will be ON.
    Network 4:
    If cycle is ON and actual temperature of heating tank (MD10) is greater or equal than set temperature (70°C), outlet valve V4 (Q0.2) will be ON
    Network 5:
    If cycle is ON and actual temperature of cooling tank (MD14) is less or equal than set temperature (20°C), outlet valve V5 (Q0.3) will be ON.
    Note :- This example is only for explanation purpose only. We can implement this logic in any PLC or using relay logic. Above application may be different from actual application or may be a part of the plant logic.
    Result


    caixiaofeng
    This is a PLC Program for automatic heating and mixing of products. Learn the PLC programming with this example for engineering students.
    Heating and Mixing of Products
    Problem Description
    Make an automatic system in which two materials are collected in one tank. All materials are to be mixed till they achieve a predefined set point of temperature.
    Make a ladder program in S7-1200 PLC for this application.
    Problem Diagram

    Problem Solution
    We can solve this problem by using simple logic. For this system consider two separate level switches to detect the level of two different materials (Lets say Material A & Material B).
    Also consider one level switch for empty level detection.
    For controlling the level we can use single acting valve (fully open and fully close type).
    For mixing, agitator is used and it is connected with motor shaft.
    Heater and temperature sensor are installed inside the tank.
    Here materials are mixed until it reaches the set point of temperature and after mixing, outlet valve (Q0.4) will be operated to drain the mixed products.
    List of Inputs & Outputs
    Inputs List
    Cycle START :- I0.0 Cycle STOP :- I0.1 Level of material B :- I0.2 Level of material A :- I0.3 Empty level switch :- I0.4 Temperature sensor :- I0.5 Outputs List
    Inlet valve 1 :- Q0.0 Inlet valve 2 :- Q0.1 Agitator motor :- Q0.2 Heater :- Q0.3 Outlet valve :- Q0.4 M Memory
    M0.0 :- Cycle ON PLC Program for heating and mixing of product




    Program Explained
    In this problem, we will consider S7-1200 PLC and TIA portal software for programming.
    Network 1:
    This network shows simple latching circuit for cycle ON and cycle OFF. Normally Open (NO) contact of cycle START button (I0.0) and NC contact of cycle STOP button (I0.1) for cycle activation.
    Network 2:
    This network is to operate Inlet Valve 1(Q0.0). It is operated when Low Level of the tank is detected (I0.4). And it is closed when Level Material A is detected by a switch with address (I0.3). START PB (I0.0) also connected in parallel so if low level not detected, inlet valve can be started by pressing START PB (I0.0).
    Network 3:
    This network is to operate inlet valve 2 (Q0.2).It is operated when material A is filled with its desired level. When cycle is running and level of material A is detected, inlet valve 2 (Q0.1) will be ON.
    Network 4:
    This network is to operate agitator motor and heater. When tank is full with material A and material B, heater (Q0.3) and agitator motor (Q0.2) will be ON.
    Network 5:
    When entire mixing process and heating are completed, outlet valve (Q0.4) will be ON. NC contact of empty level switch (I0.4) is used to stop the outlet valve when tank is empty.
    Note :- Above logic is for explanation of certain application only. The diagram is for representation purpose, actual system might be different form this system.
    Result


    caixiaofeng
    This is the PLC Program for Alarm Security Systems. Learn the PLC programming with this example problem.
    Alarm Security System
    Problem Description
    Make burglar alarm system program in S7-1200 PLC for the house.
    Consider one house, in this we want to arrange automatic burglar alarm security system. Alarm should be ON when any person will be detected by the motion sensor.
    Problem Diagram

    Problem Solution
    We can solve this problem by using simple logic. Here we can use two sensors, one motion sensor and second window sensor. Window sensor is the loop of wires.
    The motion sensor is designed such that when person is detected in a house or room, then the sensor will be activated (change its state to 1 or true)
    Here important point in window sensor is that current is always passing until the breakage occurs in the glass. Hence output always true and when someone will try to break the window glass, current will not flow in the circuit.
    List of Inputs and Outputs
    Inputs List
    System START :- I0.0 System STOP :- I0.1 Motion detector :- I0.2 Window sensor :- I0.3 Alarm stop button :- I0.4 Outputs List
    Alarm :- Q0.0 M Memory
    M0.0 :- Master coil. M0.1 :- Alarm on condition. PLC Ladder Diagram for Alarm Security System


    Program Description
    In this problem we will consider S7-1200 PLC and TIA portal software for programming.
    Network 1:
    This network shows simple latching circuit for system ON and system OFF.
    we used Normally Open (NO) contact of system START button (I0.0) and NC contact of system STOP button (I0.1) for system activation.
    Network 2:
    When system is activate and motion sensor (I0.2) detects the person entry, alarm on (M0.1) condition will be ON and it will activate the alarm (Q0.0).
    Normally NC contact of window sensor (I0.3) is used in parallel so in normal condition it is true. If breakage of glass or window condition is detected, window sensor (I0.3) input goes false and it will activate the alarm condition (M0.1).
    Network 3:
    In this network latching circuit is used for alarm (Q0.0). If alarm condition is detected (M0.1), alarm will be ON and it can be stopped by pressing alarm STOP PB (I0.4).
    Note :- Above logic is for explanation purpose only. We can implement this example by using hard wired relay logic also. S7-1200 PLC system is so costly for this simple system.
    Result


    caixiaofeng
    PLC Timer Programming Examples – TON, TOF, TP and TONR
    Discuss about PLC Timer Programming Examples: Different PLC Timers are TON, TOF, TP, and TONR. PLC Timer Instructions and PLC Timer logic examples.
    PLC Timer Programming
    Implementation of IEC timers (TON, TOF, TP &TONR) in S7-1200 PLC using TIA Portal.
    In many applications, there is a requirement to control time or signal flow. For example, a valve, or a motor might need to be controlled to operate for a particular interval of time, switched ON after some time interval or after some delay.
    Problem Diagram

    Problem Solution
    For this problem, we will use IEC timers (TON, TOF, TP &TONR) in S7-1200 PLC with examples.
    There are a number of different forms of timers that can be found in PLCs. As shown in the above diagram,
    ON delay timer which becomes ON after a particular time delay. Off delay timers are ON for a fixed period of time after turning OFF input. Pulse timer switches ON or OFF for a fixed period of time. Accumulator timer is which records time intervals. Here consider the example of four motors and four SWITCHES for an explanation of timers. We need to start three motors in different ways.
    The first motor will start after a 10 sec delay, the second motor will start immediately and off after a 10 sec delay and the third motor will start with a pulse and off with a 10-second delay. The fourth motor will run for a total of 10 sec. List of Inputs/Outputs
    Inputs List
    SWITCH 1: I0.0 SWITCH 2: I0.1 SWITCH 3: I0.2 SWITCH 4: I0.3 Reset: I0.4 Outputs List
    MOTOR 1: Q0.0 MOTOR 2: Q0.1 MOTOR 3: Q0.2 MOTOR 4: Q0.3 PLC Ladder diagram for Timers
    We can use the Generate-ON-delay or ON delay timer instruction to delay the setting of the Q output by the programmed duration PT. The instruction is started when the result of the input IN changes from 0 to 1 (positive edge).
    You can monitor the current time value at the ET output of the Timer block. The timer value starts at T#0s and ends when the value of duration PT is reached. The ET output is reset as soon as the signal state at the IN input changes to 0.

    We can use the Generate off-delay or off-delay timer instruction to delay resetting of the Q output by the programmed duration PT.
    The Q output is set when the result of the logic operation (RLO) at input IN changes from 0 to 1 (positive signal edge).
    We can monitor the current time value at the ET output.

    We can use the Generate pulse instruction to set the output Q for a programmed duration.
    The instruction is started when the result of the input IN changes from 0 to 1 (positive edge).
    Programmed time (PT) begins when the instruction starts. In this timer even if a new positive edge is detected, the signal state at the output Q is not affected as long as the PT time duration is running.

    The Time accumulator instruction or accumulator timer is used to accumulate time values within a period set by the programmed time (PT) parameter.
    When the signal state at input IN changes from 0 to 1 (positive edge), the instruction is executed, and the duration PT starts.
    In this case, the Q parameter remains set to 1, even when the signal state at the IN parameter changes from 1 to 0″(negative edge). The R input resets the output Q.

    Program Description
    In this problem we will consider S7-1200 PLC and TIA portal software for programming.
    Network 1:
    In this network we have used ON delay timer (generate on delay) for MOTOR 1(Q0.0).
    When the status of the SWITCH 1(I0.0) changes from 0 to 1 the timer instruction will be executed and it will activate the MOTOR 1(Q0.0) after 10s delay.
    Network 2:
    In this network we have used off delay timer (generate off delay) for MOTOR 2(Q0.1).
    When the status of the SWITCH 2(I0.1) changes from 0 to 1 the timer instruction will be executed and it will activate the MOTOR 2(Q0.1) immediately.
    Also when the SWITCH 2(I0.1) status changes back to 0 then programmed time (PT) will start and after time MOTOR 2(Q0.1) will be OFF.
    Network 3:
    In this network we have used pulse timer (generate pulse) for MOTOR 3(Q0.2).
    When the status of the SWITCH 3(I0.2) changes from 0 to 1 the timer instruction will be executed and it will activate the MOTOR 3(Q0.2) immediately.
    In this case even new positive edge is detected, the status of the MOTOR 3(Q0.2) is not affected as long as programmed time (PT) is running.
    Network 4:
    In this network we have used accumulator timer (accumulator time) for MOTOR 4(Q0.3).When the status of the SWITCH 4(I0.3) changes from 0 to 1 the timer instruction will be executed and MOTOR 4(Q0.3) will start after 10s.
    The MOTOR 4(Q0.2) will remain ON, even when the input status changes back to 0.The Reset (I0.4) is necessary to reset the timer or accumulated time.
    Runtime Test Cases


    xiangjinjiao
    Design a PLC program for an alternate output circuit with a latched function and explain the ladder logic with a solution.
    Alternate Output Circuit
    Problem Description
    Setting the light ON by pressing a SWITCH on 1st time, 3rd time, 5th time etc. and setting the same light OFF by pressing the SWITCH by 2nd time , 4th time, 6th time etc.
    Restore the output status to “0” when system or cycle power up. Output can be START by pressing a BUTTON in ODD number of times and can be STOP by pressing the same BUTTON by EVEN number of times.
    Problem Diagram

    Problem Solution
    We can solve this problem by using simple Ladder logic. In this we consider one simple example of alternate LED operation.
    Here we consider one LED and one BUTTON. Press the BUTTON alternately and output should be ON/OFF alternately, here during the Button pressed odd number times then output should be ON and during the button pressing even number of times then the output should be OFF.
    List of PLC Inputs & Outputs
    Inputs List
    SWITCH : I0.0 Output List
    LED : Q0.0 M Memory
    M0.0 for LED reset condition M0.1 for counter reset M11.0 & M11.1 – Positive edge Ladder Diagram for alternate output circuit (with latched function)




    PLC Program Description
    In this application, we have used Siemens S7-300 PLC and TIA Portal Software for programming.
    Network 1:
    In network 1 we have used SET instruction to set the LED (Q0.0). Here we have taken NO contact of BUTTON (I0.0)
    so LED (Q0.0) can be activated by pressing BUTTON (I0.0).
    Network 2:
    Here we used a counter so it will count the switching times of the BUTTON (I0.0).
    This counter will tell us about the number of times the button is pressed, its value or the value is a EVEN number or ODD number.
    Network 3:
    When counter will reach its preset value (2) or say EVEN number of times, NO contact of the counter will set the M0.0 (LED reset condition).
    Network 4:
    In this network NO contact of the M0.0 will RESET the LED and counter.
    Here M0.1 (counter reset memory) will RESET the counter.
    Network 5:
    If M0.0 is ON and negative transition (from 1 to 0) of button (I0.0) will be triggered then RESET condition of LED will be OFF.
    Note : This example is provided to understand the basic concept of alternate output circuit, it is not full application but we can use this concept in any automation application or any system.
    Test Cases


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