Being a better programmer

Join Date
Jun 2007
Location
Oxford, UK
Posts
163
So. I am no longer an apprentice, as my name suggests. I am quite a number of years into being a PLC programmer in various ways.

I now am finding I am using perhaps not the best working practices simply due to not getting much education these days and getting over problems on the fly. I wanted to start a little series of trying to sharpen my skills. I have a project using WinCC in TIA portal. Never used WinCC, never used TIA Portal. The project is now complete but I have access pretty much every week and want to use it to work on my skills.

So, I am going to explain how I did something, and I wondered if you had comments on the technique and practices and if I am being a bit rubbish and how to improve.

I need to load a HMI screen in sequence for checks by the operator. The checks can be configured on an admin screen on the HMI. When the operator starts the checks I have some code in the PLC checking which check sequence they have started then load the data into the a DB in the PLC from a master DB. This "HMI DB" is then shown on the HMI. When the user selects "next", I move the data back and load the next check to the "HMI DB". No scripting in the HMI, single tags on data fields then load everything on click, but in the PLC.

Is this good practice? I am thinking more and more that it is a long winded painful way to do something. How would you do it?

Is my explanation as bad as it looks? I realised half way through typing that explaining this isnt as easy as I had thought
 
Keeping software simple and easy for others to understand is key.

Yes, there is better/faster/cleaner ways of doing it with a small script in the HMI. However will the maintenance understand it? If you leave the company will others be able to follow what you have done.

The way you've done it maybe long winded and use more memory than necessary, but if it's easy to follow what's happening and it works. All is good.
 
Doing it that way is common in automotive facilities in America. They do it that way so that someone can make changes to the HMI without actually knowing how to use the HMI software. They want every system to be able to be handled by the stereotypical "dumb" sparkie who can barely be trusted in LAD, because that way they don't have to pay enough to hire competent staff.

Is it a best practice? Depends what you're optimizing for. It isn't how I'd prefer to do things, but it sure isn't wrong.
 
Doing it that way is common in automotive facilities in America. They do it that way so that someone can make changes to the HMI without actually knowing how to use the HMI software. They want every system to be able to be handled by the stereotypical "dumb" sparkie who can barely be trusted in LAD, because that way they don't have to pay enough to hire competent staff.

Is it a best practice? Depends what you're optimizing for. It isn't how I'd prefer to do things, but it sure isn't wrong.

You know I did it for that very reason. I expected the customer to change their mind as they expanded the system from the pricey Comfort panels to a cheap unit. This way I didnt need to rescript the HMI. It was dumb data showing device.

Keeping software simple and easy for others to understand is key.

Yes, there is better/faster/cleaner ways of doing it with a small script in the HMI. However will the maintenance understand it? If you leave the company will others be able to follow what you have done.

The way you've done it maybe long winded and use more memory than necessary, but if it's easy to follow what's happening and it works. All is good.
Is it bad I hate scripting? I have never liked it. I have been maintenance, commissioning engineer, planning engineer. All across those roles I avoid scripting like the plague.

Maybe I should look at it. Would make my PLC code much more lightweight. Just feel it is invisible processing that the engineers have to look in 2 places to see, but it does mean my PLC does a lot more work and read writes.

The screens work lovely and the customer is very happy. I need to clean up the way I do things but when time is tight and I am working later into the night I tend to have weird and wonderful ideas. Sometimes I look back and go... why the hell is that in it's own DB with a completely new type of name? You already created a DB for those type of flags. Meh, I guess you have to learn and use the time available to you.

Still want to be better though. My PLC writing skills are sharper than ever and is building up at a good rate, just my efficiency and know how of more diverse stuff isn't what it could be.
 
Still want to be better though. My PLC writing skills are sharper than ever and is building up at a good rate, just my efficiency and know how of more diverse stuff isn't what it could be.


Just keep that attitude until retirement. That may sound a bit condescending, but it is actually what discriminates an excellent craftsman from a good or average one.
 
Just keep that attitude until retirement. That may sound a bit condescending, but it is actually what discriminates an excellent craftsman from a good or average one.

I will try. Hitting a bit of a wall recently with trying to learn. Finding projects that are actually interesting and have time to do properly and learn and develop is hard. Maybe in the next few years.
 
I've been programming for 42 years, and I always find a better way to do something!

I think the key to being a good programmer is the ability to make your programs flow in the logical sense. Meaning I always try to make my programs flow in the way the end user would think of Starting and getting to the End.

I also try to comment my programs in a way that it can not be misunderstood. There have been times when I need to reevaluate a program I wrote 25 years ago, and the comments help me to understand how I was thinking when I wrote that program.

I don't comment a program for someone else, I comment the program for ME!

There is always more than 1 one to skin a cat, but I do think some ways are better than others.

As long as you work toward programming with the lease amount of steps, memory, and make sure at least you can debug it, I think would be a good working program.

Learning more than a single program language will also help in understanding how programs should be built.

This is just an opinion of an OLD MAN.
 

Similar Topics

Hi All, we've recently upgraded from FTView SE v10 to v12. Since the upgrade we've been having a problem where the HMI is slow to update tags in...
Replies
0
Views
41
Hey all, I am currently working on a depalletizer for a customer and we are doing a hoist upgrade. This is a SLC500 processor and the drives are...
Replies
6
Views
186
Software Ver. 22.00.00, After the 1st time of being true the EQL. instruction is still allowing the rung to be true even though the inputs are...
Replies
7
Views
186
I'm pretty new to PLC's, so forgive me if I use the wrong terminology and whatnot. We have an issue at work where we have a flow meter that is...
Replies
10
Views
270
All, We have a site that has multiple Altivar 66's that are being controlled by an old Square D Modbus+ network. One of the VFD's has failed...
Replies
2
Views
354
Back
Top Bottom