Fundamentals of PLC Programming: A Beginner’s Guide to PLC Hardware

Fundamentals of PLC Programming: A Beginner's Guide to PLC Hardware

This thing can be quite confusing for beginners; just looking at that pile of PLC models can be overwhelming. I have been in this industry for nearly 20 years and have seen too many novices struggling with books only to arrive on-site completely lost. Let’s get to the point: when selecting a PLC, don’t just look at the specifications; the key is whether it fits your application scenario.

ab

Old Siemens or AB? Don’t get hung up on it

Back in 2018, I visited a paper mill in Suzhou and saw them using Siemens S7-1200 to control the entire production line. I was so frustrated that I turned around and left. Can that piece of junk keep up with the processing speed of paper-making equipment? Nonsense! The key is the application scenario; for small machinery, the 300 series is sufficient, but for more complex process control, the 1500 series is a must, with a much lower packet loss rate.

By the way, I don’t touch Japanese PLCs at all; Mitsubishi and Omron’s programming software is truly user-unfriendly. I remember once helping a friend out, and when I opened GXworks, I wanted to curse; it took me ages to find the menu… AB’s Studio 5000, although expensive, is worth the money because it’s user-friendly.

Speaking of IO interfaces, many people don’t know the difference between digital and analog signals. Digital signals are binary, either 0 or 1, while analog signals can represent a range of values, typically 0-10V or 4-20mA. Can you control a motor with digital signals? How fast? What is the temperature? Choosing the wrong IO type can prevent the entire system from running; I encountered this just last month when an engineer used a digital module to read sensor signals, and it failed miserably!

1

Communication Protocols

In today’s factory automation, an engineer who doesn’t know how to network is like a cripple. Profinet, EtherNET/IP, Modbus… If you’re not familiar with these terms, go back and study up. Different protocols have different architectures; they are not interchangeable.

For example, in the summer of 2019, I was networking with Profinet on an automotive line with 12 Siemens stations, and that engineer insisted on adding an AB device. The two protocols were incompatible, which drove me crazy. In the end, we had to add a gateway device, wasting an extra 20,000 yuan. Why not plan it out properly from the start?

Each manufacturer’s communication parameter configuration is also different; configuring AB’s RSLinx with IP and Siemens’ TIA Portal is completely different. I often see people struggling to connect for ages, when in fact, they just didn’t pay attention to the subnet mask and gateway. Don’t come to me with these questions; I’ve taught this so many times… Basic knowledge, please!

I personally prefer Siemens’ Profinet and AB’s DeviceNet; they are stable and robust on-site. As for those domestic PLCs with their self-invented communication protocols, to be honest, they have a ton of issues. A few months ago, while on a business trip to Chongqing, I saw a system using a certain domestic PLC, and the communication packet loss was so severe that I couldn’t help but laugh…

// Key points for S7-1500 communication settings
// This is the most common Profinet configuration example
Device_1.IPAddress = "192.168.0.1"; // PLC IP
Device_1.SubnetMask = "255.255.255.0"; // Don't mess this up
Device_1.UpdateTime = 1; // ms, this is crucial, affects the scan cycle

2

Power Supply and Grounding Pitfalls

Electrical noise is something that no one cares about until it causes problems; once it does, the entire system can blow up. I’ve seen a 24V power module connected incorrectly, frying a whole row of IO cards, resulting in a loss of hundreds of thousands. You young people really need to pay attention to these details.

Grounding! Grounding! Grounding! I can’t stress this enough. The quality of the ground connection determines system stability. Once, I went to a factory in Hebei where the equipment kept restarting for no reason. After three days of investigation, we found out it was interference from the workshop’s welding machine due to poor grounding. Why make such a rookie mistake?

To put it simply, an electrical system has two aspects: one is signals, and the other is power supply. Signals need to be clean, and power must be stable. Many people overlook the stability of the power supply, resulting in wasted efforts on signal processing. Remember to provide a regulated power supply and UPS for the PLC; don’t skimp on this money, as the loss from data loss during a power outage is much greater.

Choosing the right IO card is also a science. I’ve seen too many people buy third-party IO cards to save money, only to encounter inexplicable faults. Cheap products are often of poor quality; for critical equipment, always use original parts. Spending a little more can save you months of hassle.

// Basic logic for power protection
IF Power_Input < MinVoltage OR Power_Input > MaxVoltage THEN
    Emergency_Shutdown();  // Emergency shutdown
    Alert_Operator();      // Alarm
END_IF

3

Maintenance is Key

Buying good equipment without proper maintenance will lead to problems in a few years. PLCs also require regular maintenance, such as memory defragmentation, program backups, and log cleaning; these are basic skills.

In 2021, a paper mill ran a program for five years without a backup, and when the CPU module failed, the entire plant was shut down for three days to reprogram, resulting in millions in losses. How hard is it to do backups?

Additionally, heat dissipation is crucial; excessive cabinet temperatures are the worst nightmare for PLCs. Poor temperature control in electrical cabinets can halve the lifespan of components. In my current projects, I always implement forced cooling and monitoring for cabinets; if the temperature exceeds limits, it triggers an alarm.

Lastly, let me mention that learning about PLC hardware is not just about looking at specification sheets; you must also understand the processes. Even if you memorize all the PLC parameters, if you don’t understand the on-site processes, you are still an electrical novice. Last year, a young engineer came to me with a bunch of manuals asking how to select a model. I asked him, “What is your load? What is the temperature range of the working environment? Are there any explosion-proof requirements?”… He was dumbfounded. This is the key to selection, not just the brand and model numbers..

When it comes to brand selection, remember this: Siemens is stable, AB is flexible, and Mitsubishi is cost-effective; it depends on what you need. Hardware is the foundation, but the program is the soul; even the best PLC will run poorly if programmed with bad code. We can talk about the pitfalls of PLC programming sometime; there are many more than with hardware…

Fundamentals of PLC Programming: A Beginner's Guide to PLC Hardware

Before you go, remember to click Looking~

Leave a Comment