petrb

Siemens S7 STL Basics

9 posts in this topic

Could someone refresh my memory how bit instructions works in STL in Siemens.

A     M      0.0
L     S5T#2S
SD    T      0

=     Q      0.0

Status of Q0.0 depends on RLO of A M0.0. If I modify a program little bit:

A     M      0.0
L     S5T#2S
SD    T      0

A     M      0.1
=     Q      0.0

Now status depends only on RLO of A M0.1, not on A M0.0 anymore. How's that?
Siemens manual says: You can terminate a Boolean bit logic string by using =/S/R, which is not this case.

Share this post


Link to post
Share on other sites

**I'm NOT an STL expert but I've had to decipher it sometimes**

Investigate how the SD instruction affects the RLO. Is it true after the SD as soon as "A M0.0" is true or only after T0 times out? Or something else?

The SD instruction itself may terminate the boolean bit logic string as well.

To get Q0.0 to depend on both the timer being done and M0.1, you may need something like this:

A M  0.0
L S5T#2S
SD T  0

A T  0
A M  0.1
= Q  0.0

 

Share this post


Link to post
Share on other sites

SD doesn't affect RLO, RLO depends only on M0.0.

I'm not really trying to program anything, I just wonder why it's behaving like this.

Share this post


Link to post
Share on other sites

Posted (edited)

You must read carefully the timer instructions. 

On first example the timer use an output ( can be a memory bit or an output )

When you ad the M0.1, on reality you do not assign an output to time in order to be used later on your program. 

Therefore you will not involve the delayed signal from M0.0 later on other logical.

This is the reason for which on second part the Q0.0 is no more affected by M0.0.

You just create to sequences:

one which start the timer by M0.0 and the 

second change the output Q0.0 according M0.1

Please, look at example on next link

http://plc.mavjuz.com/en/siemens/simatic/step5/timers.html

 

Edited by dekor
Adding more information and example

Share this post


Link to post
Share on other sites

Thanks, but that's not what I'm asking. I know, if I want to use timer output, I have to use "A T0".
I don't understand, why in first example status of Q0.0 depends on M0.0, but suddenly what I add additional condition (A M0.1), Q0.0 is not affected by first condition (A M0.0). Please read my post more carefully.

Share this post


Link to post
Share on other sites

The starting of the timer (SD T0) is an output function, this effectivley terminates the logic network (rung), the

A     M      0.1
=     Q      0.0

Is then deemed a new network (rung). Try drawing it out in ladder to visualise.

 

Steve

Share this post


Link to post
Share on other sites

Posted (edited)

14 hours ago, nehpets said:

The starting of the timer (SD T0) is an output function, this effectivley terminates the logic network (rung), the
A     M      0.1
=     Q      0.0
Is then deemed a new network (rung). Try drawing it out in ladder to visualise.

That's what I would thought too, but then in this logic

A     M      0.0
L     S5T#2S
SD    T      0

=     Q      0.0

Q0.0 should be always on, but it is not.

Edited by petrb

Share this post


Link to post
Share on other sites

Alright, if I try to draw this logic in LAD, it doesn't allow me and get error msg "The coil/assignment requires a preceding boolean logic operation", but in STL I can do it.

Share this post


Link to post
Share on other sites

Your STL would equate to this in ladder

 

Steve

 

snip.jpg

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now