Newbie: Ladder best practice

Varri

Member
Join Date
Jan 2020
Location
South
Posts
30
Greetings!
So in these corona-times i work a little with fine tuning some programs. Im self learned with somachine basic.
Looking back at some projects i see that i my ladder if often to complex, interlock on interlock and so on :)

How do you experts do a simple thing as this: Set/reset of a bit used for running the sequence? Startbit off= stop sequence and return to start. Two examples

https://imgur.com/ePWmCXh
https://imgur.com/GTP3QHl
 
There is nothing wrong in the initial stage by ensuring you include plenty of interlocks, however, it can make the logic complex and often programmers will re-visit to reduce the complexity, but this can cause mistakes that may not show up initially. Programmers have their own ideas on sequences and how you control them personally I prefer using a register and integer rather than use bits. This gives a number of advantages, 1. you can use the value in the sequence register to possibly display messages on the screen what the current sequence is processing for example 10 = Startup, 20 = Adding ingredient X 30 = Settling etc. 2. Also if your documentation shows the step numbers and the process, displaying the value on the screen of an HMI can be useful for diagnostics, i.e. if it is stuck on a sequence it will tell you which one.
3. Also jumping back/forward & to idle is easy. a good example is the following:
based on recipe handling. split the seq. numbers into 0-500, 600-700, 800-1000 etc.
0-500 could be used for initial process start up (note: use increments of 10 or above this leaves spares for including extra steps). 600-700 could be water addition 1, 800-1000 powder addition 2 and so on.
10000 - step on.
The idea is that a recipe may have a number of processes i.e additions of ingredients, mix sequences, heating sequences etc. if the recipe contains type of addition or process this can be checked and the sequence forced to the start of that sequence step.
Example
Recipe fields are:
Type of process i.e. 1=Mix, 2=Heating, 3=Manual addition, 4=QA checks, 5=water addition, 6=powder addition, 7=discharge so this first variable will contain a number depicting the process required, the recipe steps are loaded and this variable is checked and forces the seq. to that area. when complete this would then force the seq. word to say 10000 to increment the recipe data, then force it back to the start of recipe addition and check the next type of recipe function. each of the program blocks a called based on the value in the seq. word so for water addition a compare for a value of between 600 and 700 will enable the call of block/program for water addition.
Many here will have their own preferences and ideas on how it should be done or not done and I'm sure you will get plenty of ideas both good and bad.
 
Of course, you could then purchase a very expensive simulation package like PICS, but this is probably more expensive than the cost of the PLC, I used it extensively some years ago & it was brilliant but for different PLC's you had to purchase I/O drivers for each one as well. We also used something called Prosis, this was dedicated to Siemens S5, it was software on a PC with an interface card that fitted into the PLC Rack so you did not need I/O cards and the simulation was written in Pascal.
 
I personally avoid set/reset bits and use the start/stop circuit. While sitting on a bucket at 10:00 PM the increased visibility makes debugging ever so much easier.
 

Similar Topics

So hey guys, new here. Long time listener first time poster. Have a question for you. I'm looking to get into some rudimentary programming...
Replies
12
Views
5,214
Wonder if anyone would like to help This is a question I dont really know where to start to find the answer. I am very much a 'newbie', have only...
Replies
20
Views
12,245
Hello all, I'm a new member here. I've joined as I want to learn about PLC programming. I've got a few questions to begin with. To get me...
Replies
37
Views
4,557
Howdy folks. Been doing PLC programming for like 15 years now in LD and ST, but I'm trying to learn SFC now and have a kind of dumb question... I...
Replies
4
Views
1,396
Hello. New to Unity and had a couple quick questions. Can a Modicon M340 output to a small multiline LCD screen and not a full HMI?
Replies
4
Views
964
Back
Top Bottom