converting STL to LAD and vice versa

Pandiani

Lifetime Supporting Member
Join Date
Apr 2005
Location
Tz
Posts
725
Hello, I opened sample project mix in step7. Problem is that program is mostly written in STL and parts cannot be converted to LAD.
For example I found something like this:
 
A "A"
L S5T#10S
SD "Timer"
AN "A"
R "Timer"
A "Timer"
= "F"



I cannot convert this to LAD. But I have a little understanding of ladder rung like in attacment.
When convert that diagram I get:

A "A"
L S5T#10S
SD "Timer"
AN "A"
R "Timer"
NOP 0
NOP 0
A "Timer"
= "F"




I suspect NOP 0 has something to do with other two timer outputs.
Am I right?
Why is that not necessary in STL
Does that mean that program written in STL is faster?
Thanks
 
Last edited:
The NOP's are placeholders that are only needed so that the code can be displayed as LAD or FBD. You right that they are for the unused outputs of the timer instruction.
In STL you can often simply omit the code bits that you dont need.

STL can be faster or lot faster than LAD, but it can also be more cryptic or a lot more cryptic than LAD.
 
hai
jesper is right these are nothing bit no operation bits the out puts (2) are not used so they are listed as NOP
 
Does that mean that program written in STL is faster?

Yes. Unless your program consists of only simple boolean instructions, STL will run much faster. And if there is a bunch of math, comparison, or conversion instructions, the scan time of ladder can be three times as long.

Also, looking at your code example, you could make it a little simpler by removing the reset instruction (it's automatically reset when the input goes false):

A "A"
L S5T#10S
SD "Timer"
NOP 0
NOP 0
NOP 0
A "Timer"
= "F"

The same thing in STL is:

A "A"
L S5T#10S
SD "Timer"
A "Timer"
= "F"

Each NOP instruction takes a certain amount of time to be executed, so depending on the CPU, this timer alone needs 30% longer in LAD vs STL. I'll leave it up to you to decide whether that's important for your particular project.
 
Also, looking at your code example, you could make it a little simpler by removing the reset instruction (it's automatically reset when the input goes false):



I'd never really thought about it before, but when you mentioned it, I realised I've known this for ages. But something rang a bell, so I went looking and sure enough, this is exactly how Siemens program their timers in the examples in "Programming with Step 7 V5.1"!

Just realised that may not be quite clear. In their examples Siemens also use the

AN "A"
R "Timer"

construction.
 
Last edited:

Similar Topics

Hi i want to Convert this Block in Ladder Language.thanks AN M0.0 JC ntw2 CALL "BLKMOV" SRCBLK :=P#DB2.DBX0.0 BYTE...
Replies
0
Views
1,675
Hello all, I have a Step5 program written in STL, and wish to convert it into the LAD representation. I've been told that this is possible if...
Replies
18
Views
11,348
Is it possible to convert an STL block to display in LAD by default? I would like to generate a source file and compile it into a ladder block...
Replies
3
Views
5,963
Hello everyone, can anyone help me with covert the STL code to ladder. Iam using plc s71200. A %DB1.DBX33.7 // angel of vaccum...
Replies
2
Views
232
Hello nice to meet you, im new in here, I'm currently trying to convert code written in STL for a S7-400 to SCL for an S7-1500, because when i run...
Replies
5
Views
398
Back
Top Bottom