The Scientific Approach to PLC Programming
The process of programming scientifically is actually quite simple, but it is often overlooked by many engineers due to its perceived simplicity. Neglecting these details inevitably leads to future issues. To avoid such problems, one must strictly adhere to the rules; without rules, there can be no success, and this applies equally to PLC programming.
Below, I outline the logical steps for PLC programming:
Step 1: Read the Product Manual
This might seem obvious, but many equipment engineers might argue that they've worked with a machine for years, performing daily maintenance without needing the manual. This is a common ailment among engineers in many countries; often, from the moment a piece of equipment is purchased until it's obsolete, no one thoroughly reads the manual. Instead, understanding comes from supplier training sessions. However, if a brief training could fully explain a device's features, why would international standards require detailed manuals? Have you read the safety guidelines word by word? Have you looked at each component's description and calibration methods?
We often ignore the product manual, with many even discarding it or stashing it somewhere out of sight. Reading the manual meticulously is the first step in programming. Start with the safety guidelines to understand which actuators could be hazardous, where collisions might occur, and how to address dangers — all critical issues covered in the safety section.
Moreover, the manual contains details on each component's characteristics, usage, and calibration methods. Without this knowledge, even a correct program won't function if the components aren't properly set up. Additionally, all circuit diagrams, pneumatic/hydraulic circuit diagrams, and assembly drawings are in the manual, essential for understanding possible modifications.
Step 2: Check I/O According to the Manual
After thoroughly reading the manual, move to checking I/O, commonly known as "point checking." There are numerous methods to check I/O, but always follow the addresses provided by the manual under safe conditions.
When checking input points, typically you're dealing with various sensors like capacitive, inductive, photoelectric, piezoresistive, ultrasonic, magnetic, and limit switches. Checking these is straightforward; place the workpiece at the station or move the actuator to see if the sensor signals correctly, though methods can vary by device.
For output signals, caution is paramount. For electrical devices, ensure safety and no risk of collision before energizing actuators. For hydraulic or pneumatic systems, manually energize the directional valve in a safe environment. Always refer to the component manual to ensure safety, as not all actuators can be tested by simply applying power.
When sensors signal or actuators are energized, simultaneously check if the PLC's I/O module indicators light up. Sometimes, terminal block lights might be on, but a break in the wiring could prevent the signal from reaching the PLC.
After measuring, document the addresses to ensure they match the manual. If discrepancies arise, recheck multiple times; if issues persist, contact the manufacturer, as there might be errors in the provided addresses.
Step 3: Open Programming Software, Configure Hardware, and Enter I/O Addresses into the Symbol Table
Different PLCs use different software, but the initial step for all is hardware configuration according to the PLC type, setting up communication. Post-configuration, input the I/O addresses from your notes into the software's symbol table. The specifics of symbol table definitions might vary by software, but this step is crucial. Naming and annotating each address in the symbol table makes subsequent programming much simpler.
Step 4: Draft the Program Flowchart
Before coding, sketch out the program's flowchart on paper. A complete program should include a main program, stop routine, emergency stop, and reset functions, ideally modularized if the software allows, so each module can be called as needed.
Sequential control, which PLCs excel at, hinges on a correct main flow. Ensure this flow is correct on your draft before proceeding; any errors here could lead to collisions, damaging equipment or posing risks.
Step 5: Write the Program in Software
With a verified main flow, write the program, ensuring the accuracy of stop, emergency stop, and reset routines. These are critical for safety, ensuring no harm comes to personnel or equipment upon execution.
Step 6: Debug the Program
Debugging can be approached in two ways:
- If possible, use software simulation for testing, though complex programs might not be fully debugged this way.
Step 7: After Debugging, Edit the Program
Post-debugging modifications require another full review and edit before the final program is downloaded to the PLC.
Step 8: Save the Program
Save the final program securely. Avoid using hard drives or USB sticks due to virus risks; instead, burn the program onto a CD. Ensure you burn the program from the PLC after confirming it operates flawlessly.
Step 9: Write the Report
Document the debugging process and any challenges or notable programming techniques. This is invaluable for future reference or for colleagues to understand your work.