best plc programming tips:

I'll second the mapping recommendations. It makes the whole program easier to follow, and if you have a PLC input or output go bad on a card, you can easily change the map to a spare I/O point without having to change the software.

Always 'start' from the output. Once you know what your outputs are, you know what it is you need to control. This also means I should be able to open the program and quickly find the output (which should only be in one place!)

Always date your files! 2022-04-18 is ISO format and makes for easy sorting! I usually keep an AM and PM copy. After about 2 days, I go back and delete unwanted copies - but I know some guys who keep the whole lot.
 
STOP USING ALL CAPS FOR TAG NAMES AND COMMENTS. Also spel your tags gud.

If a naming scheme is implemented on a system... use it! Stop defeating good design with lazy ****.
 
So ISO date but not time? o_O

Well, I typically work in the morning, grab something to eat in the afternoon, and work in the afternoon.

So, I really only keep up to 2 programs a day - an "AM" and "PM". I haven't run into a situation where I need to know exactly what time I last worked on it - just whether I worked on it in the morning or afternoon.
 
STOP USING ALL CAPS FOR TAG NAMES AND COMMENTS. Also spel your tags gud.

If a naming scheme is implemented on a system... use it! Stop defeating good design with lazy ****.

All caps is till pretty common. Generally, you don't program PLCs in C/C++, and if you were to make a set of electrical drawings to do a simple relay panel the descriptions and text would be in all caps. PLCs replace relays, hence all caps.

I'm sure this will probably change in the future as more people with IT backgrounds infiltrate the trade. When I was teaching, the younger generation who grew up with the internet was appalled that technical drawings used all capital letters.
 
All caps is till pretty common. Generally, you don't program PLCs in C/C++, and if you were to make a set of electrical drawings to do a simple relay panel the descriptions and text would be in all caps. PLCs replace relays, hence all caps.
That is not the best argumentation IMO.
All caps is not the most readable.
If you have a warning sign or like that, then yes in that case I am all for all caps, also labels on IO for components and field devices must be identical with the schematics, but other that that, no.
One should chose what is the most readable on the PC screen when you write the code. I dont see any valid reasoning in that 'PLCs replace relays, that is why code and commenting must be in all caps'.
IF ALL CAPS IS MORE READABLE THEN I SUGGEST WE ALL START POSTING EXCLUSIVELY IN ALL CAPS. THAT'L BE GREAT.
 
That is not the best argumentation IMO.
All caps is not the most readable.
If you have a warning sign or like that, then yes in that case I am all for all caps, also labels on IO for components and field devices must be identical with the schematics, but other that that, no.
One should chose what is the most readable on the PC screen when you write the code. I dont see any valid reasoning in that 'PLCs replace relays, that is why code and commenting must be in all caps'.
IF ALL CAPS IS MORE READABLE THEN I SUGGEST WE ALL START POSTING EXCLUSIVELY IN ALL CAPS. THAT'L BE GREAT.

Personally I do find all caps easier to read. My handwriting is all capitals. Our HMI screens (and most others I've seen) are generally in all caps. All of the device tags and labels on the machine are in all caps (not just electrical - mechanical as well) Only very recently have we moved away from the HMI in all caps with the ISA standard. It's an engineering / drafting vs programming thing IMO. If you are in a building or industry where they do things that way, it is because that is the tradition.

It's only in recent years now that ALL CAPS IS SOMEHOW CONSIDERED SHOUTING ONLINE that I've seen any real aversion to all capital letters.

As I said - we get some of the younger kids who come into work who finds this strange. I'm sure it will gradually go away sort of like the whole "Master / Slave" debate and other things in the industry as us older guys get pushed out.
 
Use a font that clearly identifies a zero/zed from the letter "O". I use Consolas when I can. Since this is a computer/software setting it tends to help me more than the people I am programming for.

As a former instructor, I was always writing out stuff on a whiteboard. I learned that it helped my students to put a slash through my zeroes so they could distinguish them from the letter "O". Same with the number 7. I would put a horizontal line through it so it wasn't confused with a one, an "I", or an "l". The seven is clear enough with most any font, but the zero I always found frustratingly similar to "O" in most font types.

A little thing I found useful.

OG
 
Use a font that clearly identifies a zero/zed from the letter "O". I use Consolas when I can. Since this is a computer/software setting it tends to help me more than the people I am programming for.

As a former instructor, I was always writing out stuff on a whiteboard. I learned that it helped my students to put a slash through my zeroes so they could distinguish them from the letter "O". Same with the number 7. I would put a horizontal line through it so it wasn't confused with a one, an "I", or an "l". The seven is clear enough with most any font, but the zero I always found frustratingly similar to "O" in most font types.

A little thing I found useful.

OG

Or we could follow vehicle VIN regulations and prohibit the use of the letters 'O' and 'I' completely, then for sure they are 0's and 1's.
 
Use a font that clearly identifies a zero/zed from the letter "O". I use Consolas when I can. Since this is a computer/software setting it tends to help me more than the people I am programming for.

As a former instructor, I was always writing out stuff on a whiteboard. I learned that it helped my students to put a slash through my zeroes so they could distinguish them from the letter "O". Same with the number 7. I would put a horizontal line through it so it wasn't confused with a one, an "I", or an "l". The seven is clear enough with most any font, but the zero I always found frustratingly similar to "O" in most font types.

A little thing I found useful.

OG

I have always gravitated towards Courier New but I think I'm now converted to Conaolas fint ...
 
and go!
I'll start.
Always comment the Boolean instruction for their TRUE state.
For example. It is much easier to read a normally closed contact as NOT + the TRUE state of the comment instead of trying to figure out: Ok, the float switch is N.C. but held open yada yada or, the PE is light operate, so ...

LOL please see my Avatar for how NOT to comment your addresses...
 
Here's a really stupid error that I made the first time I used TIA. It will absolutely allow you to assign multiple things to the same bit.
For example I'd written a program that used say M10.0, but also had a real/double word value that was assigned to MD8, which takes up MB8, MB9, MB10 and MB11. As my value was changing, M10.0 was seeminly doing whatever the hell it wanted as that bit was encompassed in the MD8 value. Then I found the assignment list and realised what an idiot I am.


Been there, done that.

In a case like that, when I use an instruction which uses multiple memory locations I annotate the assigned but not overtly visible memory locations with a simple "Used". Time well spent.
 
Just ran across another one today:


Always make conveyor photo-eye on when clear. The code reads so much easier when
-] [- means if the eye it clear and
-]/[- means if the eye is blocked.


That is all...
 
All caps was all I ever saw on CAD drawings and PLC documentation from the early 80’s until I retired in 2019. Other technical documentation used traditional upper/lower case letters.

Sometime after the dot.com revolution began someone arbitrarily decided that all caps meant “SHOUTING.” Why this is, is beyond me. Some IT nerd probably got their panties in a twist or whatever.

As far as fonts go, I don’t care as long as there is a clear distinction between O’s and 0’s and Capital i’s, small l’s, and 1’s.

As I type this the youngsters who seem to now believe it is not necessary to use punctuation or use any capitalization at all.

I’m old and tired. NOW GET OFF MY LAWN!!
 
Last edited:

Similar Topics

Hi there PLC aficionados, I have a quick question for you. Do you use Linux in your integrator/automation engineer/Technician role? If, yes which...
Replies
20
Views
8,192
hello, I got a job in a factory. I would like to develop my PLC programming skills. I know that every person has his own way of learning but if...
Replies
9
Views
2,473
Or, what PLC do you enjoy programming the most? I enjoy programming software/environments that allow me to mix different languages. I like to do...
Replies
13
Views
6,164
I have a business in the packaging industry and I would like to get proficient with PLC programming, troubleshooting, etc. I come from a computer...
Replies
6
Views
10,002
Old topic, but since serial ports are disapearing rapidly, ...I thought I'd ask the question again.
Replies
20
Views
12,101
Back
Top Bottom