How To Start A Ladder

Write a test plan that the software must pass to meet the spec.

Then write the code to pass the test.

<hr>

Another useful technique is to rewrite the spec and submit it to the customer. This is sometimes called a Functional Requirements Spec, or a Detailed Design Spec, depending on the level of detail of the spec you start with, and what you produce.

If you do it right, each sentence or paragraph becomes a rung comment. Program each rung to match the comment (which is how you should code anyway).

Presto. Perfect code.
 
I suspect you are asking a question much more basic than Allen saw.

I suspect you are asking... "What should Rung-1 look like?"
I also suspect that your "spec" is NOT referring to a customer spec, but rather, some kind of PLC standard.

If that is so, then the answer is... There ain't no spec regarding the first rung! or the second, or the third...

It's all up to YOUR understanding of the details associated with your needs.

I will say, however, you should create your code in such a way that as many decisions as possible are made in a single scan rather than from scan to scan. The scan-to-scan method is called "Advance to the Rear". That method is very time consuming in critical systems.

Sometimes you have to wait for a change in an Input, so you have to wait for a scan or two. Sometimes you don't have to have an Input change - In those cases, make your decisions in the same scan. This requires that your code be setup to "Advance Forward".
 
"How is the most intelligent way to start the ladder to meet the spec's?"

I've never seen any specs for ladder exept of a general structure. Some have pretty complete specs on structure, not on how you'll make da thingy work.

They say thing like... all Grafcet will include a reset BIT. All actions will be driven by an internal BIT and these real output BIT will be place at the end of the Grafcet... Every lines or rung will have 3 lines of comments and you can only put a maximum of 2 parallel branches in a rung, etc, etc.

The more precise the specs are, the bigger the xcrew-up...

It is becoming so difficult to find a descent programmer that some companies thinck that by specifying the manner in which the program will be made, thay will assure a minimum of ease to troubleshoot or modify in the futur. Not so!

To start intelligently a ladder, in order to meet the specs... make a checklist of the specs and check all when done...

IMHO, a high level programming laguage like LL is only good when it does what its made for... i.e. make the machine work according to specs.

If you have caught 90% of the "what-ifs" by your analysis and you have a good, well organised and documented structure... then your not an intelligent but just a good programmer.

Some of my programs are just so dumb simple... some have thousand of lines but are still so dumb simple.

A-Write down the I/O list
B-Write down the process description
C-Write the Flowchart (or something close to it in your own words)
D-Mess it up with the What-Ifs :confused:
E-Write down your guess about the structure
F-Chesk if all this meets the specs ???
G-Write down your first line comments
H-Make the code match these comments
... Lather-Rinse-Repeat ...

As for what could the first rung be... myne are ALWAYS the same.

BUZZERS and ALARMS annonciators. When I have to intervine it's usually the first place I look for... and it's on the first line also :)

Try and find in the archive one of Terry's post which was darn good on this structure thingy...
 
JDW said:
The old cause and effect scenario

Actually, in Education circles it's called "teaching to the test". It's frowned upon because it make kids into 'automatons' instead of 'knowledge seekers'.

But 'automatons' are exactly what we're after when we program PLCs.

Now if only I could get my kids to follow my instructions the way I get my PLCs to....
 
Vilmenay, I'm afraid you are confusing people. Some of the possible questions you mayhave intended o ask are:

1) What should the opening lines of a program be?
2) Are there initialization routines I should use?

3) What is a reccommended program structure?

4) What is a preferred methodolgy for organizing my project and creating the program?

A little clarification on what you need help accomplishing would be good.
 

Similar Topics

So I very much new to doing ladder coding I have a pump with a Stop float switch that stops the pump when a sump is low. I want my manual run mode...
Replies
13
Views
1,380
Hello, I am trying to detect when the PLC changes from STOP to START mode. This can be considered an edge case scenario, but I would to analyze...
Replies
4
Views
1,561
Hi, I have no idea of programming PLCs, what is the best way to start, first design the program using a flow chart ?? then break down the flow...
Replies
3
Views
2,743
I have attached image of my ladder. I am using siemens plc s7 cpu 226 dc/dc/dc. I want to start timer as soon as input is given to it. I want to...
Replies
1
Views
2,082
T
Please help me writting ladder logix for queing a request to start a pump. I have a pump and three remote operator stations. Station A: if...
Replies
11
Views
9,861
Back
Top Bottom