Is this wikipedia sample PLC program right?

Karoly

Member
Join Date
May 2012
Location
Doha
Posts
24
Please refer to this link.

I understand an input to PLC is high if the physical contacts are closed and low otherwise. But in the water level controller sample program in wikipedia referred above high level and low level float switches are open (input low) when water is above them and vice versa. That means for the fill valve to be latched open both inputs should be high. But this sample program shows both input should be low for the valve to be latched. Have I got any fundamental problem?
 
It is because it is an N.C. PLC contact of an N.C. physical input. The signal is inverted twice.
When water is below a level switch --> input goes OFF.
When address linked to N.C. contact in PLC program goes OFF, --> resulting PLC signal goes ON.
 
Thanks Jesper,

"It is because it is an N.C. PLC contact of an N.C. physical input." Does a PLC care whether it is dealing with a NO physical input or NC physical input? Where do we enter such information in a PLC program? I believe (and hope) still the mentioned wikipedia logic is not the ladder logic that we actually enter in a PLC program, in which case we have to show High level and low level input both high, right? I look forward to your kind reply.
 
The PLC only "cares" about the voltage level of the electrical signal applied to any of its Input points.
For example, if you are using a 24 VDC-Sink (PNP) PLC input point, and apply 24 VDC (+) at the respective point terminal connection, the CPU will "read" the state of the Input as "High" (1); there is no need for user configuration.
If the said Input point memory address state is being "attached" to a logical NO (Normally Open)"contact" then the respective instruction will be "considered" as TRUE if the respective Input point is "high".
If the same Input memory address is "attached" to a logical NC (Normally Closed) "contact", the logic result of the application scan will be FALSE.
 
Does a PLC care whether it is dealing with a NO physical input or NC physical input?
It is your job as the programmer to take it the logic functionality into account.

Where do we enter such information in a PLC program?
You take care of it when you create the logic. Wether a signal is from a N.O. or N.C. switch or sensor is a good idea to add to the comments for the PLC input.

I believe (and hope) still the mentioned wikipedia logic is not the ladder logic that we actually enter in a PLC program,
As far as I can see, the PLC logic on the wikipedia page is correct wrong.
 
Last edited:
I see now that you are right. The wikipedia page is wrong.
The text says:
When the water level is below both switches, the float switch physical contacts are both closed,
"Closed" in the electrical sense the signal is ON.
For that to start the pump, the logic contacts in the PLC program must be N.O., not N.C. as in the wikipedia example.

edit: Maybe the ladder logic was lifted straight from an electrical diagram without thought to that the PLC signal state would be wrong due to two times N.C. makes an N.O.
 
Last edited:
@dmargineau

I can accept the "logical NC (Normally Closed) 'contact'" as an advanced feature, even though I am hearing it only now (as I am not an expert), but still I dont see its place in the said wikipedia page, that too as the default feature (which should actually be the "logical NO (Normally Open)'contact'"). Am I right?
 
Normally open and normally closed contacts are common, not "advanced".

Any time that you want to turn something on when something else is off you need an N.C. contact.
Or when you need to turn something off when something else is on.
 
I agree that the Wikipedia example is confusing; it looks like it was inserted within by a PLC "Theory" professional and it is intended for "general" public information.
The posted rung is actually trying to exemplify the TRUE LOGIC state of the system (at a given moment in time- when empty))and not functional ladder logic code based on the given input information.
Good catch...:sick:👨🏻‍🏫
 
It is an example of bad commenting.
"low level" ???
Is the signal ON when the sensor is activated (water is over the sensor) or the opposite.

i would have made the Symbol comment like this:
"Above_low_level_NC".

One could argue that it would be functionally the same as "Below_low_level_NO", but I prefer that the "NO" or "NC" follow exactly the type of the physical contact.
 
Where do we enter such information in a PLC program?
Comments attached to the rung and to the instruction is where you put information that someone may need to know at some time in the future. (Most likely that person will be you).

Of course the comments have to be correct. A comment with an error is not much better than no comments at all.
 
I guess the author is putting across the actual physical logic for a layman (when the water level is low both switches are "Normally Closed" which condition should energize the fill valve) with no introduction to the ladder logic programming, as dmargineau suggested. In that case I guess this is a good idea, but still I think it is better to clarify this in the article page not to confuse those who know a little ladder logic programming.
 
I guess the author is putting across the actual physical logic for a layman (when the water level is low both switches are "Normally Closed" which condition should energize the fill valve) with no introduction to the ladder logic programming, as dmargineau suggested.
The truth is that the Wikipedia author's Low Level and High Level instructions for a PLC program are incorrect. They should both use a open instruction in the PLC program to look at Normally Closed physical Level Switch contacts. This is a very common error. People get confused between the physical switch contacts and the instructions in the PLC program. Those are two different objects or places, so at times they may not look the same.
 
But Lancie think of a person trying to learn about PLC which the article is supposed to cater to. In that case such a presentation is justifiable, if not ingenious, as it tries to convey the ladder logic concept by physically identifiable concepts.

But no doubt it will certainly confuse those with at least a little knowledge of ladder logic programming.
 
Don't worry, I edited the Wikipedia article "Programmable Logic Controller" and fixed the contacts as we all think they should be. The next time you look at it, it should be correct.
 

Similar Topics

I was looking through wikipedia, and was curious to see what they had for PLCs and was very disappointed with the article. I made a few minor...
Replies
2
Views
1,975
I am looking for any simple sample isp plc file for a Delta PLC. I currently have version 3.06 if that matters. I am looking to practice...
Replies
1
Views
587
Hello Guys, Can anyone share the Combined tube autopilot program If anybody worked with it.. we have newly installed this Auto pilot CT which is...
Replies
8
Views
1,348
I need to locate a better sample pump than this. While these work, they just aren't built for years of service. 120V supply and in a damp...
Replies
15
Views
2,720
Anyone have a AVEVA Historian DB backup I could have a sample of? We are considering taking on a project that involves dealing with data from...
Replies
0
Views
1,143
Back
Top Bottom