Ladder or SCL

amancini

Member
Join Date
Mar 2024
Location
maribor
Posts
5
Hi,
I have an intermediate-advance knowledge of programming with TIA Porta in Ladder, would you recommend me to start learning SCL for it to become my usual programming language?
Thank you.
 
Almost certainly yes, but learn all of them, as an oem or systems house programmer you will get customers who request other languages like LAD or ST or FBD SCL, if you work in some form of production environment even if your company requests a certain language, you will get perhaps a standard built system where the cost of having it done in a certain form would cost too much so the company may accept the original form. Also do not limit yourself to one platform i.e. Siemens it gives you a better chance of getting a job in another company if you wish to do so.
 
I find LAD easiest for logic operations, example, this contact AND that contact, OR this contact.
Logic is more of a pain in SCL because it uses a minimum of three lines of code, you have to use IF - THEN, your code, and END_IF, but SCL is way better than LAD for calculations.
So , yes learn SCL, but no, don't think of it as your usual programming language. Use a mix of languages, whatever is best for what you are trying to do. TIA allows you to insert an SCL rung in to a LAD program so there is no reason not to mix and match.
 
Logic is more of a pain in SCL because it uses a minimum of three lines of code, you have to use IF - THEN, your code, and END_IF, but SCL is way better than LAD for calculations.
No disrespect intended here, but if you're equating a rung like you describe to a IF - THEN, then you don't know much of SCL.

Code:
coilResult := ThisContact AND ThatContact OR ThatCondition;

This is the equivalent of what you were trying to say and has no IF involved.

You are aboslutely right that to troubleshoot digital logic, SCL is far from perfect and the more "visual" languages are definitely the way to go.

With Siemens this is much less of a problem since you can define the language per rung. But in other platforms means you have to create blocks where to drop your SCL logic, which excels in calculations and array based logic/loops.

Also worth learning CFC or Rockwell FBD which is different from Siemens FBD but also very powerful language.
 
For S7-300/400 I would write 30% in LAD and 70% in SCL. The reason for the bigger part being in SCL was that in S7-300/400 there are many things you cannot do in LAD. Indirect addressing, looping, multiple 'views' of the same data (the 'AT' method) ..
In S7-300/400, you would have to use STL or SCL to do more 'advanced' stuff.

In S7-1200/1500, there are no limitations any more. You can do the same in LAD as you can in SCL (to 99.9%).
The reason to use SCL is that it is better for shuffling data and looping.
The reason to use LAD is that it is easier to write logic, and particularly to debug logic online. In SCL, logic with a lot of brackets becomes confusing whereas LAD is much more visual.

So in S7-1200/1500 the proportions for me are 70% LAD and 30% SCL.
I would not recommend to exclusively use SCL.
 
I agree with Jesper, I have had the unfortunate experience where the works chief engineer insisted on ST (SCL) this caused a number of problems it definitely took longer to code & debug, the engineers on site were not happy at all & my name was mud to them even though I explained it was what your chief wanted, it was a case of a know it all (well he thought he did) wanted to make himself look good This is the sort of guy I had to deal with, "Look I have the latest IPhone, it can do this & that", I would reply so does mine but it only cost £150.00, I'm sure most of the people on this site have seen these sort of people.
 
I agree with Jesper, I have had the unfortunate experience where the works chief engineer insisted on ST (SCL) this caused a number of problems it definitely took longer to code & debug

This is why I keep SCL/STL to a minimum. I'm not an expert by any means, but the poor bloke who's trying to figure out why the machine won't run in ten years time will almost certainly know less than me, so it will probably help keeping it in a format that's understandable.

As Jesper said, there's very little you can't do in LAD with a 1200 or 1500.
 
I did most of my code in STL in the S5 days as at that time FB's could only be written in STL, & quite frankly I preferred it unlike ST(SCL) it was fast to enter but hard for engineers to understand so in essence I wrote things like output handling in ladder program blocks but the control was almost STL in FB's (There were no FC's as such). Also the use of perhaps many opening & closing brackets was a pain to remember much easier to do in ladder, although I got very experienced in that so for me wasn't a problem but others struggled. I also remember I used to write all my program blocks in STL but ensured I got the bracketing & segment end instructions right so it would translate into ladder for me it definitely was faster, unfortunately, the FB's could not be shown in ladder.
I remember a guy asked me to convert a program he had uploaded from an S5 110 i think it was, he used a PG675, however, it was written using a handheld programmer & had no segment ends in it so could not be displayed in ladder, I went through the program inserting the segment end instructions (**** or BLD255) & it translated it into ladder, I downloaded it to the PLC & from that point on it was all in ladder.
 
I Have programmed siemens allmost 20 years. I have only needed SCL or STL on that time maybe 5 or 10 times and they were usually older codes programmed by others or needed indirect addressing on 300/400. Learn ladder and FBD first. STL and SCL is good to know and them are still needed sometimes but I try avoid them.
 
As in S5 FB's could only be programmed in STL & I cut my teeth on S5 in the early 80's, used it upto 2000, I loved it but it is not really required so much now as many of the functions that could only be done in STL can be done in LAD/FBD or what ever you want to call it, I do not really like ST apart from complex calculations which I do agree is much better, not much point in using ST for normal Bool code. (note: for those that are not aware ST & STL are totally different), ST is a structured language like Pascal where STL is akin I suppose to assembler. In saying that, STL is easily translated into ladder where ST is more complex as far as conversion into ladder due to it's supposed transportable code, yeah I can see that happening many functions in PLC's are bespoke to that p;atform (at the moment) so using ST code in different platforms would still take a lot of manipulation to get it to work.
For example take some simple code in one PLC.
INT_To_Str
possibly in another platform this would be
Int_To_STR so even the letter case may cause an error
Also things lilke tags, in certain platforms you could use a name like Stop_Drive
but in another Stop may be a reserved word so will not compile.
 

Similar Topics

Well i have found myself in a purely ladder programming environment at new engineering company. I have done troubleshooting and of course it was...
Replies
14
Views
4,500
I am working on a com block to a motion controller. I got the basic part of it working in ladder. Now I need to put it into SCL so I can put it...
Replies
12
Views
6,100
I got my PanelView Plus 7 working with a Micrologix 1500. How would I connect my laptop to the PanelView to view the ladder logic while operating...
Replies
6
Views
136
please help me . I have to make this ladder diagram and I can’t figure it out :(
Replies
12
Views
346
Hello, I am trying to replicate a piece of logic on the PLC5 onto an SEL RTAC. I am using ladder on SEL and FBD. I am having issue on the ladder...
Replies
13
Views
232
Back
Top Bottom