Step 7 LAD > STL ???

Zombo

Member
Join Date
Nov 2003
Location
PA
Posts
50
I am doing a program in the LAD format.
Then automatically the rungs in the
program become in the STL format. I can
not convert them back even though I have
chosen LAD in the veiw section. Anybody
know why? Plus how to get it back to ladder
format?
 
Hello Zombo;
When you say that Step 7 modifies your LAD into STL automatically, do you mean without your requesting it? Does it do it while you are programming, or do you see the changes when you open a file that you saved earlier? I have never seen that happen since I have version 5.x I think I remember something like that with version 3.3.
What version and which OS do you use?

Anyway, I am including an image that I prepared for an earlier post; it shows a simple LAD network, and its STL translation. Notice the jump-to-label instruction (jump if false) thast is inserted after the inital logic, and the "NOP 0" instruction if the RLO is false. These instructions are essential to translate from STL to LAD or FBD; they define the start and end of the graphic blocs used to show STL: instructions in other formats. They do not modify the STL logic (unless you count the microseconds needed to process them); they are only there as cosmetic help.
So you can insert these JNB (Label) and Label: NOP 0 liones in your STL: networks, and then request Step7 to go back to LAD view. It has to be done network by network, though. Good luck.
Hope this helps,
Daniel Chartier
 
I have never seen this either. I am running Step7 V5.1. There are definitely STL constructs that will not convert to ladder. But I have never seen a case where I have developed something in ladder and Step7 has AUTOMATICALLY displayed it as STL.
I have had cases where I have developed something in ladder and later added some STL. In the STL section I use a local variable (TEMP) that is used by the ladder editor for something. This happens especially with function calls and other complex block instructions. I will get a warning that I am using something the ladder editor needs for display purposes and if I use the local variable I give up my ability to view in ladder.
You might also notice an instruction in STL that looks like 'BLD 103'. This is used for displaying ladder elements. While it performs no function it is needed to display in ladder. You don't want to delete these if you want to view in ladder.
I don't know if this is what is happening to you but these are a couple of things I have come across.

Keith
 
I have some fair sized programs that were written in ladder but can be viewed in LAD or STL. I think the option settings could determine what view it opens to, you should be able to use ctrl 1 to get LAD view.

An STL program cannot always be converted back to LAD but I havent seen a LAD program that cant be viewed as STL or FBD in Simatic S7.

Then again I aint all that good so may not have a clue what I am talking about.
 
Zombo,
You are not alone. This has happened to me without warning. I don't know why either. I run V5.1, SP6 and Windows ME. Dchartier, thanks for the conversion tip.
 
I'm not sure why I missed this last time. While Step7 certainly inserts items for ladder viewing, Daniel's example isn't one of those cases.
Daniel's example is a conditional move. He only wants to execute the move if his leading condition is true. Math and move instructions in the S7 don't directly look at the status of the RLO to decide if they are supposed to execute. You need to jump around them if you don't want them to execute. That is what the jump and label in Daniel's post do. They make the move conditional. As a test, put an unconditional move in a network in ladder and then convert it to STL. You won't see the jump or label in this case. You will just see:
L ???
T ???

Keith
 
Zombo, could you give us an example of the STL code that will not convert to ladder? I program in STL so I know little about ladder, but I can at least tell if the STL logic has ladder conversion elements in it.
 
I've seen LAD changing to STL in Step7 v5.1 in some situations.

Example:

When using ADD_I block in LAD. If IN1, IN2 or OUT variable is defined in symboltable or DB as datatype WORD then STEP 7 don't give you an error but turns the representation to STL. In STL it's possible to use different datatypes.

In Step7 v5.2--> if you try to insert variable with wrong datatype then you will get an error message "type conflict with entry in the symbol table" or "actual datatype WORD does not fit the formal type INT of the formal parameter"
 
Tesalmin,

there's a simple workaround for what you're telling. If you go to Options - Customize in the Editor you can deselect 'Type Check of Addresses'. When you do so, STEP7 can show LAD and FBD where the types are not what they're supposed to be, eg. comparing of non-integers (bytes and words for instance) or math where the same applies.

Kind regards,

ladfbd_options.gif
 
I tried deselecting the "type check of addresses" box. It still does not go
back to LAD. I narrowed it down to what
instruction causes it change to STL.
Its when I add the reset branch with the
not instruction then do a save. I am
using Windows XP professional and Step
7 V5.2 Rev. V.5.2.0.0

A M 10.4
A Q 31.0
AN T 21
= L 0.0
A L 0.0
FP M 105.3
= L 0.1
A L 0.1
JNB _021
L MD 214
T MD 110
_021: NOP 0
A L 0.1
JNB _022
L MD 214
L 2.000000e+000
+R
T MD 114
_022: NOP 0
A L 0.1
JNB _023
L MD 214
L 2.000000e+000
-R
T MD 118
_023: NOP 0
A L 0.1
JNB _02b
L PIW 522
T MW 122
_02b: NOP 0
A L 0.1
BLD 102
S M 105.4
A L 0.0
NOT
R M 105.4
 
Zombo, I just tried your code, and it translates to ladder just fine. I checked my revisions, and I am running 5.2 SP 1, Rev 5.2.1, so maybe that has something to do with it. For what it's worth, since I never use ladder, I am using all of the default options in the customization page.
 
S7Guy,

I can second you. I have the same version and the code provided converts to LAD just fine here too. I didn't have to change anything to the default settings either. Guess it's the version that does the trick. But since I am working with Windows 2000 professional the problem could also be the Windows version. Microsoft has been known for their 'non-problemfree' software.

Kind regards,
 
Last edited:
I've been told this can happen if you have nested functions too deep or if there is a jump to a name you have declared elseware. The jump problem may occur if the default name Step 7 uses internally to the ladder matches a declaration you used already.
 

Similar Topics

Can somebody help me to translate these lines in STL to a LAD i can´t find the real logic, O #F_reset_pulse_raise O...
Replies
9
Views
3,686
Why is it sometimes my STL will not convert to Ladder Logic?
Replies
4
Views
2,367
I have a hard type grasping branches (I guess they'd be ORs of some sort) in STL. I'm a LAD guy myself. I'd like to display this network in LAD...
Replies
8
Views
5,636
I am trying to convert some block calls from STL to LAD and I need a little help. In the attached file I have network 3 in STL and network 4 in...
Replies
2
Views
4,397
H
hello, i have purchased this step7 book used and unfortunatly did not recive the disk that comes with all the examples, if any one has it please...
Replies
18
Views
13,179
Back
Top Bottom