Basic programming: please give my student your opinion

ivo.maenen

Member
Join Date
Nov 2003
Posts
663
Hello people,

I'm teaching a course to some students who already programmed plc's for about two years. So you can say they have had a fairly good training in plc-programming.

I started 'basic' because of their different backgrounds and because they have used different plc's and software. I have shown ladderprogramming and how to use AND- and OR-blocks. I have also shown them some basic means of documentation. So this post is not about 'documenting programs'.

One of the first projects is to start and stop a machine with two start- and 2 stop-pushbuttons. Of course there is a motorbreaker (MBS) that protects the motor against a short-circuit and overload. A signal-light (H1) has to light up when the motorbreaker is off. For this there is a NO-direct switching auxillary-contact (MBS) wired to the inputs.

By the way in the program 'stap' means step in english.

I don' want to influence your opinion so I will not give you more background info.

Please feel free to comment on the project that he wrote. Hopefully he, I and other students can learn from it.

The more people give an opinion, even if this is the same, the better.

If you don't feel like repeating somebodies opinion, just use quote and say that you agree with this quote.

Thanks for your time and effort.


Regards,

Ivo Maenen
 
Speaking as a former PLC and SCADA trainer I would call this overkill. I don't see any reason to use the Grafcet principle for a simple start/stop circuit. It complicates troubleshooting. This could have been done with simple relay logic.

Let him try to get grasp of the KISS principle. I'm fairly sure he is more trained in computer or microprocessor programming than in electric/electronic skills. At least this kind of solution is what I have seen from people coming from the IT side and converting to automation technicians.

Kind regards and good luck in your teaching job,
 
The initial values of both STOP pushbuttons are FALSE. Traditionally they would be TRUE because Stop pushbuttons are wired Normally Closed or TRUE, and the PLC input is then ON in the RUN mode, so that a broken wire will shut down the equipment. This kind of logic flaw is missed by using strictly block-type logic programming.
 
Agree all round - definately ladder and stop buttons wired N/C.
Why would anyone choose Grafcet I wonder?
 
For beginner circuits i think ladder is better and i would suggest using self latching circuits. Personally im not a big fan of the Set Rests on motor control for beginner circuits.

I like to brake circuits up into different sections.

I would typically have an interlock circuit which if any of the conditions are made equal a interlock bit. Same with the controlled stop bit i will have a separate rung to allow for variances in timers and so on.

Interlock ex........................................Interlock Memory
-[ ]-------------------------------------------( )-

Stop ex...............................................Stop Memory
-[ ]------------{timer}------------------------( )-

Start Circuit

Start Condition........Stop M.......Interlock M......Drive Output
-[ ]-----------------[/]---------[/]------------( )--
.........-
-[ ]----
Output retain coil
 
I agree with the above - PLC's are largely designed to be maintianed by the electrician/technician level. It is no coincidence that ladder logic resembles relay logic. The keys to good programming are:
1. Simple
2. Consistent
3. Organized
4. Robust
5. Recovery

The "deep, technical part" is the "robust" and "recovery". Does the code handle all the conditions and problems that may occur(robust) and what does it do when a problem occurs(recovery)?

The "simple, consistent, and organized" allows you to become more efficient in writing the code, altering the code, and troubleshooting the code. Of course, that all flows downstream to benefit the end users.

Considering this is a course, it may have been the assignment to take this approach. If that's the case, I apologize for my ramblings and I won't comment on the code because I never use anything like it.
 
" ladder logic resembles relay logic"
lets rephrase that
Relay Logic came first - Prior to the introduction of any form of electroncs.
Teach common place systems in known Logic configurations.
Grafcet etc. comes after the student understands Logic controls.
An understanding of hard wiring principles is crucial.
i.e. Stop Button wiring being Normally Closed.
look at the general lighting circuits
- Two Way
- Two Way with intermediate switch (multi-way)
- Push Button (Latch Function)
Motor Control
- DOL
- Star/Delta (Why)
- stage start ( 3 or More)
- Break Motor Control
When you approach the Automation control systems
touch the basic ladder control then introduce the
state/step process.
The Idea is to show the Value of the High level STL FBD methods.
it is better to learn from the ground up, this may prevent excessively over complex programming.
 
sorry but i do not see any aldder as first project
and grafcet is fine but not easy to start with, it is not a beginners language.
 
thats fine Shooter - but it was the only was I could learn when I was doing my apprenticeship.
Grafcet didnt exist until 10 ~ 15 years later
I did mean to learn basic logic
- A=B - light cct
- A or B = C - two way etc. (not Correct)
 
Last edited:
He asked for opinions. My opinion is that you start with ladder and work your way up to using function blocks.
 
He asked for opinions. My opinion is that you start with ladder and work your way up to using function blocks.

Rheinhardt,

thank you for taking the time to replay.

Do you mean grafcet or SFC when you say function block?

As a mather of fact that's what this post is about: how many people want him to use ladder, how many want him to use grafcet/SFC for this type of logic?
 
It doesnt really matter if its SFC,STL,LAD or whatever. I think the main idea is to teach a "clean" method of programming.

Program must be structured and read easily on paper. When using Conditions. I will have common part so that if you want to change say an interlock or stop condition you do it in one place not several.

What i meant by using function block is using Instances of function blocks. So control functions that are common to many devices like a motor start circuit can be done in a single function block.

All the parameters can then be attached to the block by defining input and output variables to the block.

The benefit of doing his code in LAD and SFC is that they are easy to debug when developing code and you are not experienced i find ladder is even easier than SFC.

I have used Graph in the past for Stop/Start sequences. Over time developed one that was easy to change for different customer requirements. It is done in STL however.

Hope this clarifies it.

One last important factor is structured naming conventions and ensuring the program sections are well commented on.
 
Last edited:
Sorry to say
ALL 3 are needed - or at least the Knowledge to transpose.
Ladder is a must
Grafcet - mainly in Europe - did not get a big push in Australia
SFC and others as above.
 
Hate FBs! PITA except for complex maths with ST - hard to trouble shoot.
I have customers all over Ozz and if the program is in ladder I can usually talk them through - FBs they do not understand.
Grafcet, SFC and ST just make life difficult.
For example, I have a standard routine I drop in for reading stuff from Caterpillar engines - drop it in and have a look and see what I get from the engine - then delete what I do not get for placement on touch screens. All the maths (32 bit floating point) are in ladder - if in FBs I have to type in a pile of stuff - in ladder I just copy and paste - it is so easy.
You never really know what you are going to get - just about every engine is different.
I did try the FB route as this is the only standard, repeatable routine I ever use - went back to ladder.
 

Similar Topics

Hello All, I am stumped on how to convert a %MW to a %MF using Machine Expert Basic and a Modicon M221. The help files show a word to a double...
Replies
4
Views
177
Hello there, I'm practically new to the PLC world, I'm quite familiar with Siemens TIA Portal but I'm currently tasked to program Schneider PLCs...
Replies
5
Views
1,880
Hello, I am new to plc programming. I am trying to program a flow meter (E&H promag 50) in somachine basic to achieve the following: 1...
Replies
5
Views
2,421
Dear experts, I am want to program RS view32 with help of Microsoft visual basic (visual basic editor). But how to start I don't know,please...
Replies
10
Views
2,405
Hello all, i am planning to start basic plc and programming classes online if anybody is interested mail me
Replies
3
Views
1,416
Back
Top Bottom