Setting Up a PLC Programming Environment: Configuration and Usage

Setting Up a PLC Programming Environment: Configuration and Usage

Recently, I’ve had several beginners asking me how to configure the PLC programming environment, and I really can’t believe it! It’s always these basic questions. Don’t you know how to use Baidu? Alright, today I’ll talk about the PLC programming environment so you don’t end up with a bunch of messy issues that require me to come in at midnight to fix.

Let’s start with the selection. Beginners should definitely use the old Siemens; don’t even think about touching those obscure brands. Forget about the Mitsubishi and Omron you learned in school; in factories, it’s basically Siemens and AB’s world. Remember that tire factory in 2019? That so-called “engineer” insisted on using domestic PLCs, and on the first day of production, it crashed, causing me to stay up for three days to recover the system. That was a painful lesson!

Of course, if you insist on asking about programming software, use STEP7 V5.6 for S7-300/400, and TIA Portal for 1200/1500. Back in the winter of 2021, I was at an electronics factory in Guangzhou, debugging the production line with a few interns. They downloaded a bunch of cracked versions, and the software crashed several times. I lost it and told them it’s better to spend a little more on the official version than to use cracked TIA, which can cause all sorts of inexplicable bugs. Oh, and by the way, don’t rush to upgrade to TIA V16 or above; V15.1SP1 is quite stable and reliable.

1

Pitfalls in Hardware Configuration

When configuring hardware, many electrical novices just pick components randomly. They see similar CPU models and choose one, only to find out during debugging that there’s not enough memory or too few communication ports—it’s ridiculous! I suggest you always choose one level up based on actual needs, it’s better to spend a little more than to work overtime to death. This field is not like software development; if you choose the wrong hardware, changing it isn’t that easy.

By the way, remember the case from last summer at that auto parts factory in Suzhou? They only required control for 50 I/O points, but Xiao Zhang insisted that S7-1211 was enough. Later, when the production line expanded, there weren’t enough I/Os, and the entire program had to be rewritten, which drove me crazy. Today’s young people just refuse to learn from the experiences of their predecessors!

// Example of configuring the S7-1500 communication port
"PROFINET Interface_1" {
    Name := "PROFINET接口_1";
    NetworkSettings {
        SyncDomain := "No";  // Don't change this casually, or the distributed I/O will explode
        IoSystem := "Default";
    }
}

The biggest pitfall during configuration is the IP address and subnet. Don’t be clever and use the 192.168.1.X subnet, as that’s commonly used for office networks, which can lead to conflicts. I usually use 192.168.0.X or 10.10.10.X, which are less likely to conflict. Once, at a paper mill in Chongqing, the PLC and HMI were configured correctly, but there was a communication timeout. After troubleshooting for a long time, it turned out the gateway address was wrong, and that broken router was using 192.168.1.1 by default, causing the conflict.

2

Software Configuration Issues

For first-time users of TIA Portal, it might be confusing. This software is not as intuitive as traditional software; the interface is as complex as a cockpit. First, don’t install it in a path with Chinese characters, and don’t install it on the C drive, or you’ll get all sorts of inexplicable errors. I always install it in an English directory on the D or E drive, and I’ve never had a problem in all these years.

After installation, the first thing to do is import the GSD file. This is the device description file; without it, your third-party devices won’t connect. But let me tell you, don’t just import all GSD files at once, my colleague Wang did that, and every time he opened the project, it would lag for ages, making him want to smash his computer. Just import the few you need; only import what you will use.

When I was training an apprentice in 2019 to configure Siemens 1500 and third-party devices, that kid wouldn’t listen and insisted on importing everything at once. As a result, it took over 10 minutes to open the project, and saving it would crash frequently. I finally couldn’t take it anymore, snatched the keyboard from him, and reinstalled it, only importing the necessary GSD files, and the problem was immediately resolved.

3

Debugging Communication Issues

Communication is a big pitfall. First, make sure to select the correct PG/PC interface; otherwise, the computer won’t connect to the PLC. I usually use Profinet, which is simple and easy to use. When directly connecting with Ethernet cables, you might need a crossover cable, depending on the model. Don’t be afraid of the hassle; it’s better to make your own cable than to use a pre-made one. I’ve lost count of how many times those so-called “network cables” just wouldn’t work, and when I checked, the wiring was all messed up.

Also, when using S7 communication, don’t forget to check the “Put/Get” access permission; otherwise, the upper-level machine won’t be able to read the data, and you’ll waste a lot of time troubleshooting. Once, at a pharmaceutical factory in Jinan, Xiao Li and I worked overtime until 3 AM just because that checkbox was not checked, and we almost got into a fight…

// Simple DB block example
DATA_BLOCK "ProjectData"
{ S7_Optimized_Access := 'FALSE' }  // Don't change this casually, or the old project's communication will explode
VERSION : 0.1
NON_RETAIN
   VAR 
      RunStatus : Bool;   // Running status
      ErrorCode : Int;    // Don't use String to store error codes, it takes up memory
   END_VAR
BEGIN
   RunStatus := false;
   ErrorCode := 0;
END_DATA_BLOCK

Lastly, when debugging the environment, don’t always think about implementing high-end features; a simple WinCC screen is enough. Don’t add flashy animations and curves, as maintaining that later will be a nightmare. I’ve seen too many programmers who are like electrical engineers, always thinking about how to make the screen look cool, but they can’t even get the basic functions right, and when they get on-site, they shake like a leaf.

When I was working on an automotive welding line, the client requested a more advanced monitoring screen. I said fine, let’s do it. But then the sales team misled the client into wanting 3D visualization. Isn’t that ridiculous? WinCC doesn’t have that capability! In the end, I had to work overnight, using some tricks to create a pseudo-3D effect to get by.

Also, project files must be backed up! It’s not enough to just have one backup; there should be at least three versions: the initial version, the intermediate version, and the final version. Store them in different places—USB drives, computers, cloud storage. The young people I’ve trained always say, “I have backups,” but when I ask, it turns out they are all on the same hard drive, and if that drive fails, everything is gone.

PLC configuration is, to put it simply, about attention to detail and experience. Don’t think you can become an expert just by reading for a couple of days; this field requires learning from mistakes. No matter how much theory you understand, if you don’t go on-site, you’re useless. Alright, that’s all for now; stop asking these basic questions and think for yourselves a bit more. If you don’t know something, just Baidu it!

Setting Up a PLC Programming Environment: Configuration and Usage

Before you go, remember to click on Looking~

Leave a Comment