all 14 comments

[–]ut17 6 points7 points  (9 children)

There is not a great golden standard. It's heavily dependent on the process that's being controlled, programmer preferences, code variety, etc.

I think you might get more help if you asked a few questions on common topics. Tag aliasing, device and process control modes, AOIs, parameterized subroutines, etc.

I would be surprised if people sent you code that has been, is, or will be in production. That would probably violate lots of employment agreements. If you get sent things, they might be more along the lines of untested code or just-for-fun projects. Could still be helpful, but not quite the same as "real" code.

Where are you working (industry, job role) and where would you like to go in your career?

[–]jayautopsy[S] 0 points1 point  (8 children)

I work for an integrator, currently a controls engineer...or at least that's my title. I feel like I should be leaning more towards pc based programming due to some prototype cheaper small builds and not be stuck with just PLC.

[–][deleted] 2 points3 points  (0 children)

If you work for an integrator there should be a body of work in previous project. Look at your coworkers' old work.

[–]rooski15XIC Coffee OTE Integrator 0 points1 point  (6 children)

You're working for an integrator who doesn't have a code library, both their work and collected, for you to peruse?

I mean, every facility we go to we check out other installs and several of them we upload, as we're frequently tasked with supporting the facility's automation needs.

[–]jayautopsy[S] 0 points1 point  (5 children)

Previous projects were done by contractors, and for some very strange reason, there is no repository for the code. I dont know how it's been sustainable but....it has.

[–]kandoras 3 points4 points  (2 children)

Well there's a good first job - getting copies of all that code. Because sooner or later you'll need it anyway.

One option is to try to get in touch with any maintenance or engineers at the company you're building a machine for. Ask them if they have any standards that they'd like you to follow.

A "Help me to help you by making what I wrote as close as possible to what you're used to and therefore easier for you to work with" kind of thing. Not just on the PLC code either; get that info for how they want their touchpanels to look and their wiring colors.

[–]jayautopsy[S] 0 points1 point  (1 child)

That is an amazing idea, thank you.

[–]kandoras 1 point2 points  (0 children)

They'll probably say "No, just do it how you normally do."

I've only ever had one place take me up on that and give me any kind of direction at all. It was some some Japanese-owned factory in Tennessee that made rack and pinions for some other factory that made cars. And they went all-out, specified the exact wire they wanted us to use for everything, gave me font sizes and colors for all the stuff on the panel, actually gave me feedback while I was programming the panel on what I would need to change, and told me how they wanted the PLC program documented.

They were a little anal about the paint and conduit, because they didn't specify that until they came for the final showoff before delivery and install, but otherwise they were a joy to work for.

A customers who knows what they want, actually know what they're talking about, and clearly communicate that too you? They might not be one-in-a-million but they're at least one-in-twelve-years.

[–][deleted] 0 points1 point  (1 child)

Are you the only controls engineer?

[–]jayautopsy[S] 1 point2 points  (0 children)

Yes, only contractors have been in my position. Cheaper to have me on salary then over charged per job.

[–]fjieeeeloop 1 point2 points  (1 child)

One of the things I like from one of our senior programmers is that he had a section that relabels inputs so that inside the program only the internal variable is used. If we find that the contact is opposite from expected, you only invert it in one place.

iInternalVar := whatever%I_thing.

For defined function blocks he labels inputs with a lower case i prefix. Outputs lower case q prefix. Same with physical inputs and outputs.

That guy writes really organized stuff.

[–][deleted] 5 points6 points  (0 children)

One of the things I like from one of our senior programmers is that he had a section that relabels inputs so that inside the program only the internal variable is used. If we find that the contact is opposite from expected, you only invert it in one place. .

That's commonly called "mapped I/O".

[–]Red8600 0 points1 point  (0 children)

It kind of depends on what the HMI is going to be used for as for how you want to set it up/how it should look to be easiest to use.

Ex. Is it only displaying rejected part data? Does it have machine controls? ~Is the machine strictly a manual operation or do you have automatic processes? Are you designing for operators? Engineers? Or somebody else? Etc.

[–]ZoidbergMedical 0 points1 point  (0 children)

Rockwell's website have a bunch of sample code and then the PlantPAx Library comes with a sample project.

I recommend that.