A bit more S7 STL to LAD help needed please?

uptown47

Lifetime Supporting Member
Join Date
Feb 2008
Location
Over there, next to those boxes
Posts
1,146
Hi
I wondered if anyone could help translate the following two networks into Lad as they don't directly translate. I've had a go myself but need someone just to check whether I'm right or not.
Code:
A M 134.4
AN T19
O M135.1
AN M136.7
= M155.0
  M134.4  T19            M155.0
---| |----|/|-------------()
                |
  M135.1 M136.7 |
---| |----|/|---
And the next one is....
Code:
A M134.6
A T19
AN M135.1
O M137.2
O M134.4
AN M136.7
= M143.0
 M134.6  T19     M135.1    M143.0
---| |----| |----|/|--------()
                     |
                     |
  M137.2             |
---| |----------------
                     |
                     |
 M134.4  M136.7      |
---| |----|/|---------

Thanks for any help you can give me with this.
Cheers
;-)
 
Code:
IF M 134.4
AND NOT T19
= RLO
IF RLO
OR M135.1
= RLO
IF RLO
AND NOT M136.7
= M155.0



AND M134.6
AND T19
AND NOT M135.1
= RLO
IF RLO
OR M137.2
OR M134.4
= RLO
IF RLO
AND NOT M136.7
= M143.0


RLO = result of logic operation.
Use the time now to learn simple conversions like that, it will save time in future.
 
Hi TurpoUrpo,

Thanks for your help (again). I want to learn this but I struggle to get my head around it.

Your explanation is excellent though.

Can I just clarify that you are saying my attempt at translating the first one is correct but the second one should be:

Code:
 M134.6  T19     M135.1    M143.0
---| |----| |----|/|--------()
                     |
                     |
  M137.2    M136.7   |
---| |------|/|------
         |
         |
 M134.4  |     
---| |----

Is that right?

Many thanks for your continued help (and patience!!)

;-)
 
No, both are wrong, you miss that last "and" is with all of code that was before it. I tried to make it more clear by showing the intermediate rlo.
 
Last edited:
So is this correct:
Code:
IF M 134.4
AND NOT T19
= RLO
IF RLO
OR M135.1
= RLO
IF RLO
AND NOT M136.7
= M155.0

  M134.4  T19      M136.7   M155.0
---| |----|/|-------|/|------()
                |
  M135.1        |
---| |----------
 
AND M134.6
AND T19
AND NOT M135.1
= RLO
IF RLO
OR M137.2
OR M134.4
= RLO
IF RLO
AND NOT M136.7
= M143.0

 M134.6  T19     M135.1  M136.7 M143.0
---| |----| |----|/|-----|/|----()
                     |
                     |
  M137.2             |
---| |---------------
         |
         |
 M134.4  |     
---| |----
???
If it is correct then I would never have got that. How do you know that the last AND (AND NOT M136.7) statement relates to all of the previous instructions and not just to the 2 OR instructions (OR M137.2 / OR M134.4) ??
Thanks again for your continued help
Cheers
;-)
 
a good way to do this and learn the conversion is to write the code you think in a new network, then change the view to STL and see what you have.
 
Hi Peter,

Thanks for your reply. I did try this but the code translates differently to the STL I have got. Although this is hardly surprising as, I would assume, if it translated to exactly the same as my original STL then my original STL would translate to Ladder ;-))

I would really like to get my head around this though so I can translate confidently in the future.

Thank you

;-)
 
Here's one for you to translate:

Code:
      A     I      0.0
      A(    
      O     I      0.1
      ON    I      0.2
      )     
      A     I      0.3
      O     
      A     I      0.4
      A(    
      A     I      0.5
      A(    
      O     I      0.6
      ON    I      0.7
      )     
      BLD   8
      O     
      A     I      1.0
      A(    
      A     I      1.1
      A     I      1.2
      O     
      AN    I      1.3
      AN    I      1.4
      )     
      BLD   8
      A(    
      O     I      1.5
      ON    I      1.6
      )     
      )     
      =     Q      0.0
 
Here's one for you to translate:

Code:
      A     I      0.0
      A(    
      O     I      0.1
      ON    I      0.2
      )     
      A     I      0.3
      O     
      A     I      0.4
      A(    
      A     I      0.5
      A(    
      O     I      0.6
      ON    I      0.7
      )     
      BLD   8
      O     
      A     I      1.0
      A(    
      A     I      1.1
      A     I      1.2
      O     
      AN    I      1.3
      AN    I      1.4
      )     
      BLD   8
      A(    
      O     I      1.5
      ON    I      1.6
      )     
      )     
      =     Q      0.0

Ha Ha... will give it a go!

In the meantime, are my corrected translations in a couple of posts above right?

Also, can someone answer why the last AND (AND NOT M136.7) statement relates to all of the previous instructions and not just to the 2 OR instructions (OR M137.2 / OR M134.4) in the example in that post.

(will post back an attempt at this translation...)

Cheers

;-)
 
What about this....?

Code:
    A     I      0.0
      A(    
      O     I      0.1
      ON    I      0.2
      )     
      A     I      0.3
      O     
      A     I      0.4
      A(    
      A     I      0.5
      A(    
      O     I      0.6
      ON    I      0.7
      )     
      BLD   8
      O     
      A     I      1.0
      A(    
      A     I      1.1
      A     I      1.2
      O     
      AN    I      1.3
      AN    I      1.4
      )     
      BLD   8
      A(    
      O     I      1.5
      ON    I      1.6
      )     
      )     
      =     Q      0.0

See attached screenshot (couldn't be bothered trying to type it all in in Notepad!)

Am I right??

Cheers

;-)

PS... Just typed the STL into S7 to try and convert it to see if I was right but it won't convert.... (presume you did that to stop me cheating!) ;-)

Image1.jpg
 
Last edited:
Ha Ha... will give it a go!

In the meantime, are my corrected translations in a couple of posts above right?

Also, can someone answer why the last AND (AND NOT M136.7) statement relates to all of the previous instructions and not just to the 2 OR instructions (OR M137.2 / OR M134.4) in the example in that post.

(will post back an attempt at this translation...)

Cheers

;-)

It relates to RLO at that point. Look for S7 help to find what statusword is and what those bits mean.
 
It relates to RLO at that point. Look for S7 help to find what statusword is and what those bits mean.

So after reading about the RLO is this correct...

Code:
A M134.6
A T19
AN M135.1
O M137.2
O M134.4
AN M136.7
= M143.0
 
 
AND M134.6
AND T19
AND NOT M135.1
= RLO
IF RLO
OR M137.2
OR M134.4
= RLO
IF RLO
AND NOT M136.7
= M143.0

 M134.6  T19     M135.1  M137.2 M136.7 M143.0
---| |----| |----|/|-----| |-----|/|----()
                     |         |
                     |         |
                     |  M134.4 |
                     -----| |---

Thanks again for your continued help

;-)
 
So is this correct:
Code:
IF M 134.4
AND NOT T19
= RLO
IF RLO
OR M135.1
= RLO
IF RLO
AND NOT M136.7
= M155.0

  M134.4  T19      M136.7   M155.0
---| |----|/|-------|/|------()
                |
  M135.1        |
---| |----------
 
AND M134.6
AND T19
AND NOT M135.1
= RLO
IF RLO
OR M137.2
OR M134.4
= RLO
IF RLO
AND NOT M136.7
= M143.0

 M134.6  T19     M135.1  M136.7 M143.0
---| |----| |----|/|-----|/|----()
                     |
                     |
  M137.2             |
---| |---------------
         |
         |
 M134.4  |     
---| |----

These are correct.
 
PS... Just typed the STL into S7 to try and convert it to see if I was right but it won't convert.... (presume you did that to stop me cheating!) ;-)

Correct, but please don't say you typed it in - hopefully you highlighted the code, copied (control+C) and then pasted it (Control+V) into a blank S7 network (viewed in STL):unsure:

(Delete the two lines of code BLD 8 and the STL will convert to ladder)
 
Last edited:
So after reading about the RLO is this correct...

Code:
A M134.6
A T19
AN M135.1
O M137.2
O M134.4
AN M136.7
= M143.0
 
IF M134.6
= RLO
IF RLO
AND T19
= RLO
IF RLO
AND NOT M135.1
= RLO
IF RLO
OR M137.2
= RLO
IF RLO
OR M134.4
= RLO
IF RLO
AND NOT M136.7
= RLO
IF RLO
= M143.0
 

Similar Topics

I have written one program with FDB. Thought I could therefor write code for an automation direct DL-06. Huge learning curve. I believe I have...
Replies
3
Views
1,758
Hello all. I've been working with Do-More designer for the past two years. I used to work with AB before then, but since the company I work with...
Replies
5
Views
2,514
Finishing up my first project with a Do-More PLC to install tomorrow morning. I'm working on small details.... like automatically adjusting for...
Replies
5
Views
1,871
Hi All I have x number of bits representing an active state on x number of valves and I want to be able to detect when more than one valve is...
Replies
7
Views
1,965
Hi guys! Newbie question or you. I'm just finishing up a diploma in Industrial Automation. But I am job hunting and I'd some clarification. We...
Replies
3
Views
2,166
Back
Top Bottom