Step 5 STL - Ladder conversion help.

stevelawson

Member
Join Date
Feb 2004
Posts
115
Hello guys.

I need some help trying to rewrite some STL code into Ladder so i can try to understand whats going on. I struggle to watch the RLO in STL and the code won't convert.

I'm pretty sure i have got it covered up to line 18 :S Q 42.4
After that i'm struggling, especially the bit between lines 18 and 26. The text in Red is where i struggle.

So, if anyone can convert the following code into Ladder for me i would be very greatful.

Just 1 other thing, what is the rule of thumb for understanding brackets? This is where it all goes Pear shaped for me.

Many thanks.

Steve.

PB10 Segment 22
:A I 1.1
:A I 2.3
:A I 2.6
:A I 3.1
:A(
:O I 0.3
:O I 0.7
)
:A(
:O
:A F 10.1
:A F 11.0
:A F 11.5
:O
:AN I 4.0
:A F 130.7
:A I 5.2
)
:S Q 42.4
:
:A I 2.1
:AN F 100.2
:= F 100.3
:
:A I 2.1
:= F 100.2
:
:A F 100.3
:A I 2.1
:R Q 42.4
:***
 
stevelawson said:
Hello guys.

:S Q 42.4
:
:A I 2.1
:AN F 100.2
:= F 100.3
:
:A I 2.1
:= F 100.2
:
:A F 100.3
:A I 2.1
:R Q 42.4
:***

F100.3 provides a one shot based on I2.1 to reset Q42.4
When I2.1 become 1 , F100.2 is FALSE for that scan, therefore
F100.3 is TRUE for that scan.

Next scan , F100.2 is TRUE, therefore F100.3 is now FALSE



Ian
 
Thanks for that Ian.

I just know i'm going to regret asking this, but whats wrong with resetting Q42.4 with :A I 2.1

I have tried to get my head around these one shots in the past and can't get it to sink in properly.

I'm now sure that this is part of the problem i'm trying to solve.
Q 42.4 is getting a random second pulse from somewhere, and the Rotary Table that it drives turns for a second time before it should do.

I have been looking at the reset I 2.1 and it would appear that it hasn't been made because F 11.0 is still set after the table has moved. See logic below.

PB10 Segment 6
: A I 0.2
: A I 0.4
: A I 0.7
: S F 11.0
:
: A I 2.1
: R F 11.0

Any further thoughts Ian.

Steve.
 
Thanks for that KRK.

I was quite a bit off the mark with my interpretation of the conversion. That one shot really threw me.

I have just been looking at the one shots in the learn PLCs on the home page of this sight. my head is hurting a bit now, but a think i am getting the jist of it.

This machine has altered alot since it was first commissioned, loads of mods using a lot more I/O.

The fault in question has just turned up out of the blue, but after further small mods have been made in a completely different area of the machine, different I/O different PBs.

Could the now longer scan time affect something like this? After reading up on one shots i would imagine not, if one line at a time is processed in a scan.

Steve.
 
KRK.
Could you please post your pdf file again. I don't know what iv'e done but i managed to delete it. I feel such a fool.

Steve.
 
Has anybody still got KRKs reply to this post. I need the pdf file posting again because this numskull has managed to delete it from his computer.
Thanks.

Steve.
 
stevelawson said:
Thanks for that Ian.

I just know i'm going to regret asking this, but whats wrong with resetting Q42.4 with :A I 2.1

I have tried to get my head around these one shots in the past and can't get it to sink in properly.

I'm now sure that this is part of the problem i'm trying to solve.
Q 42.4 is getting a random second pulse from somewhere, and the Rotary Table that it drives turns for a second time before it should do.

I have been looking at the reset I 2.1 and it would appear that it hasn't been made because F 11.0 is still set after the table has moved. See logic below.

PB10 Segment 6
: A I 0.2
: A I 0.4
: A I 0.7
: S F 11.0
:
: A I 2.1
: R F 11.0

Any further thoughts Ian.

Steve.

I don't know the thinking of the original programmer as to why they would use SET and RESET for an output. In all the PLC training I have received, SETTING and RESETTING an output is bad programming practice. The recommended method is to have various logic throughout the program and EQUATE the output in one location only.

Ian
 
stevelawson said:
PB10 Segment 22
:A I 1.1
:A I 2.3
:A I 2.6
:A I 3.1
:A(
:O I 0.3
:O I 0.7
)
:A(
:O
:A F 10.1
:A F 11.0
:A F 11.5
:O
:AN I 4.0
:A F 130.7
:A I 5.2
)
:S Q 42.4
:
:A I 2.1
:AN F 100.2
:= F 100.3
:
:A I 2.1
:= F 100.2
:
:A F 100.3
:A I 2.1
:R Q 42.4
:***

Steve,

One thing to note is that the 'O' after the A( is not required.

As for the brackets, if you look at the PDF that Kevin posted, you should see where the brackets come into play. What I tend to do when faced with a load of STL that I struggle to get my head around, is split it down to a number of different segments, then enter it into a S5 program as it is originally written, then convert it to ladder.

The sample you posted will split down to 4 segments and convert to ladder if you remove the 'O' and change the S and R to =

Paul
 
If he changes the S/R to =, it won't work correctly anymore. It will convert just fine with the S/R instructions.

And Curly, I can't think of any particular reason not to use S/R with outputs. I have been doing it that way for years with no ill effects, and I see ot often in other people's programs.
 
S7Guy said:
If he changes the S/R to =, it won't work correctly anymore. It will convert just fine with the S/R instructions.

I was telling Steve to change the S and R to = just so that he could see what the segments would look like in ladder, not for a working conversion, but having said that I wasn't sure if the S and R would convert correctly, which is another reason why I mentioned changing them to =

In Ian's defence, I think he could be talking about multiple resets of coils, all in different places, throughout the program. For example, I have had to recently trouble shoot a program written by another person that had a Merker bit being set in one place, but reset in 25 other places, spread amongst 21 FC's, the resets were all operated by one shots, this did make finding the culprit a bit of a nightmare!

I don't like to see that sort of thing going on.

Paul
 
Hi guys.
Thanks for all your help with this thread, especially to Kevin for re-posting the Ladder conversion, which i find quite eye opening.

I guess the reason why i was struggling to convert was that i was trying to keep it all in the 1 segment, (PB10 Segment 22) as the title suggests, which leads me to my next question, why isn't the one shot in Segments 23 and 24? Is this normal practice to keep both the set and reset in the same Segment, just like a S/R Flag?

Steve.
 
S7Guy said:
If he changes the S/R to =, it won't work correctly anymore. It will convert just fine with the S/R instructions.

And Curly, I can't think of any particular reason not to use S/R with outputs. I have been doing it that way for years with no ill effects, and I see ot often in other people's programs.

I prefer, and have been trained, to always EQUATE outputs in one location only, makes instructions such as MCR's easier to program if an output is only in one location

Ian
 
PLucas said:
In Ian's defence, I think he could be talking about multiple resets of coils, all in different places, throughout the program. For example, I have had to recently trouble shoot a program written by another person that had a Merker bit being set in one place, but reset in 25 other places, spread amongst 21 FC's, the resets were all operated by one shots, this did make finding the culprit a bit of a nightmare!

I don't like to see that sort of thing going on.

Paul

This isn't as hard as it might look. since they're all one shots, use couters. Count the times the one shots activate. This will narrow it down a bit without much searching/headaches.
In stead of straining the brain/eyes to see which one shot activates, just check which counter increments.

Greetz
Jeebs
 

Similar Topics

Hi Siemens Experts, I am hoping someone can shed some light on my issue. I have uploaded the code from a S7-300 (317-2PN/DP) using Step 7...
Replies
9
Views
592
I really struggle with STL in Siemens Step 7 Classic. I'll learn chunks, but then I don't use it enough to retain and build on the knowledge. When...
Replies
17
Views
3,144
Good day. I have a device on profibus that I am reading data from using SFC14. This data is written into an array within a DB. The array is 128...
Replies
6
Views
3,661
Hi all, I have been asked to make some modifications to a Siemens S7-300 which is programmed entirely in STL and commented entirely in Italian...
Replies
10
Views
3,567
Hello everyone! I've just stared with programming on STL and I have problem which I can't understand. I'm writing programs on Step 7 and I'm...
Replies
2
Views
2,166
Back
Top Bottom