Image source: Matrix Technologies
While programmable logic controllers (PLCs) are very important, the programming inside the controller is equally important and easily overlooked.
Programmable Logic Controllers (PLCs) are fundamental to many manufacturing operations, performing a wide range of tasks. While PLCs are crucial, the programming within the controller is equally important and easily overlooked. Matt Fether, a department manager at Matrix Technologies, shares insights into PLC programming and tips on how to make programming easier.
01 How to program a PLC?
Typically, development begins in the project definition phase, simultaneously generating design documents. During project execution, if the definition and documentation of the control system follow the project procedures, then controller programming is essentially an intermediate step in the project execution, offering more efficient development. Using reusable code, standard object libraries, and copying tools can further improve development efficiency.
Test programs can be used throughout the programming phase of the project. If it needs to run on multiple devices, run it on a single device first and then fully test it before deploying it to the next device.
During development, using copying tools can not only save time, but also help eliminate problems caused by "misoperation" during program development.
02. Are modifications and updates allowed?
The developed application should be easy for end users to understand. At the end of the system integration project, the developed or upgraded application needs to be handed over to the customer. Ideally, the application should be developed in a way that is easily understood by frequent system users.
Systems integrators should be partners with their clients, not developers of "proprietary" applications. Throughout the project lifecycle, integrators should collaborate with clients on design reviews. This helps ensure a seamless alignment between client expectations and the integrator's design.
Application organization should begin before programming even starts. Several factors typically need to be considered, such as the objects the application controls, the size and complexity of the system, and whether the project is entirely new or an upgrade to an existing application.
Equally important is to have in-depth discussions with customers to understand their standard terminology and factory areas so that they can be incorporated into the application. The goal is to create an application that allows end users to easily navigate to specific devices.
In the production process, ease of navigation is especially important for troubleshooting. Any unplanned downtime of the process or equipment due to "sorting out PLC codes" can result in lost revenue.
03 Professional knowledge of code debugging
When the automation engineers responsible for a project are proficient in code debugging, they can define, develop, and debug the applications they develop. This requires debugging the initially developed programs to ensure they are ready for factory acceptance testing (FAT) and on-site debugging, thereby helping clients implement a more efficient and successful project.
▲This diagram shows the PLC code for a recently implemented batch processing procedure. It uses Rockwell Automation's Studio5000 Logix Designer software and is programmed in ladder logic.
Using a comprehensive testing process early in the programming process helps eliminate time-consuming work when debugging the entire system and ensures successful application development.
In some complex cases, additional resources may be required for the final internal testing or field commissioning phase of a project. Properly defining the application and ensuring its logical organization helps achieve a near-seamless transition.
During the project debugging phase, personnel who were not involved in the project development may come in. While this is not ideal, these newcomers should be able to take over quickly as long as the project execution process is followed and a thorough handover is carried out.
04 Choosing a Programming Language
While there are several different programming languages, ladder logic is probably the most common. Some applications are written in structured text, while others use function blocks. Structured text can be used when adding functionality to an existing PLC that was originally written in structured text.
Function blocks can be used for certain tasks, such as analog input filtering or proportional-integral-derivative (PID) loops. However, some vendor software packages may require specific licenses to program using function blocks. If end users cannot access them due to current software license restrictions, using function blocks will limit the ability to view and modify the program in the future.
Once the system is operational, the programming language used by the engineering consulting firm should be easy to use to support clients. Providing end users with proprietary applications that they cannot access or maintain will actually be counterproductive. The best language for the application is the one that the client is most satisfied with after the project is completed.
05 Standards and System Architecture Design
Several factors need to be considered before developing a programmable controller application. The most critical is how the system should be architected to best suit current needs and allow for easy expansion options in the near future.
Furthermore, the controlled processes or equipment should be considered: have the correct hardware and software packages been selected for them? If the controlled system is a packaging line, is it following the OMAC PackML model or using a customer-provided model?
Before proceeding with any development, it's also necessary to consider applicable standards. Does the application conform to any ISA standards, such as the ISA-88 model for batch control? Will we be using any customer-provided or vendor-provided global objects? Questions like these help provide insight into the required controller memory size.
Another important factor to consider is the overall system architecture design. Understand what the existing or potential new network architecture will look like. For example, will the system require several communication modules to operate, while providing a robust and secure network design?
In addition, any potential interfaces with Manufacturing Execution Systems (MES) and data acquisition systems should be considered. Do these systems require any labeling structures and naming conventions that we need to incorporate into the application? These are all considerations that need to be taken into account before we begin programming.
When designing a control system, ensure that the programming meets the current needs of the application and takes into account future scalability. (Author: Matt Fether)
Key concepts:
■ Programming of the PLC begins during the project definition phase, along with the preparation of design documents.
■ PLC programming should be easy for end users to understand, and should also take into account the needs of standards and specific applications.
Think about it:
What other factors should be considered when programming a PLC?