Sign in to follow this  
Followers 0
jeffellis1

Programming Machinery From Scratch

34 posts in this topic

That is SO true! When I come across ugly logic, I generally replace it! You can break up ugly rungs without affecting the actual logic or controls, and it's good practice with your software. I have spent 95% of my time polishing turds by replacing small dysfunctional chunks, and only about 5% of my time writing my own from scratch. It can be difficult to dissect a sphagetti program to correctly replace a "chunk" of code, but you can reorganize the pieces that exist..very carefully..without actually changing how it works. Once it is organized and you have a handle on all the I/O this "chunk" needs, you can write your replacement code. Even a complex machine will have sections that can be worked on individually. If you have the choice, do start with something simple as suggested...Good Luck Edited by OkiePC

Share this post


Link to post
Share on other sites
I disagree, there is plenty to learn by examining experienced coders work. My job(s) don't allow me the luxury of going back in and recoding something so whatever I commission needs to be logical and simple for the electricians and plant control engineers that are going to be maintaining it. After twenty+ years of PLC coding there is still some things I run across everyone once in a while that I admire for the simplicity and ease of readability. I'll put it in my basket of tools.

Share this post


Link to post
Share on other sites
It won't take long to quickly recognize good examples to follow, and bad ones to disassemble and rewrite, or ignore altogether. I can see both sides to this point about looking at others' code. Edited by OkiePC

Share this post


Link to post
Share on other sites
The way I learned to program from scratch: Took a system. Learned about it. Programmed it from scratch. Fixed mistakes and learned as I went along. It wasn't really too difficult. $

Share this post


Link to post
Share on other sites
I think you took my repl a little out of context.. I said dont look at others in response to when the OP said he was confused by what others had written..as Okie said there is plenty you can look at and learn from..there is also plenty you can look at and should forget!! My first project being the prime example!! I would hate for this person to see my code and then copy it..its horrible!! However i have seen some nice work..the last machine i worked on for example..it was from the US and there was some good code there..(Documentation sucked tho)..then i went to the other machine in the same line..(It was from italy and used RSlogix 5000.) The code is ok but there is 0 rung comments and the symbols /Tags are in italian so no help there!!..It was a struggle but i got it to do what they wanted!! Ways to do and ways not to do..we see it all the time.. D

Share this post


Link to post
Share on other sites
oh, you are so right on that.

Share this post


Link to post
Share on other sites
They key is to understand how the machine works. The PLC and anything else are just tools that are needed to control the machine. The problem I see too often is that programmers understand the PLC but not the machine. Knowing how to program PLCs is not enough. You must understand the machine. You must understand the physics and how the designer expected it to run.

Share this post


Link to post
Share on other sites
Well said Rodney

Share this post


Link to post
Share on other sites
All too often they don't know

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0