S7 STL: What's the difference of these Operation:

douyi

Member
Join Date
Aug 2005
Location
Toronto
Posts
123
1.
CLR
= DB100.DBX10.0
= DB100.DBX2.7
= DB101.DBX5.1

2.
R DB100.DBX10.0
R DB100.DBX2.7
R DB101.DBX5.1

I know they are same functions to unlatch those bits. Which one is better for that propose? - Maybe after compile these are exactly the same. Who can tell me that?
 
They aren't quite the same functionally...

unless you meant to type:

SET
R DB100.DBX10.0
R DB100.DBX2.7
R DB101.DBX5.1
 
krk said:
They aren't quite the same functionally...

unless you meant to type:

SET
R DB100.DBX10.0
R DB100.DBX2.7
R DB101.DBX5.1

Do you mean if I didn't set RLO=1 then I cannot reset those bits by "R" ? That seems hard to understand.
 
douyi said:
Do you mean if I didn't set RLO=1 then I cannot reset those bits by "R" ? That seems hard to understand.
That's exactly what he meant, as that's the way it works.
Set (S) and reset (R) are RLO dependent instructions.
 
That's right, both assign (=) and reset (R) are RLO dependant

(and MCR dependant if your're using it)

Edit:
ooops...cross posted with jacekd
 
Thanks.

If it's like that, I will understand like :

for

CLR
= DB100.DBX10.0
= DB100.DBX2.7
= DB101.DBX5.1

It won't clear these bits, all the status reminds.


for

R DB100.DBX10.0
R DB100.DBX2.7
R DB101.DBX5.1

If RLO happens =1, it will do it, otherwise ignore it.

Correct?

One more question is : If processor clear RLO after finish each rung (network)?
 
Last edited:
One more question is : If processor clear RLO after finish each rung (network)?
Dont know if it resets the RLO upon finishing a rung.
But I do know that it sets the RLO upon starting a new rung.
So in you above example
(start of new rung)
R DB100.DBX10.0
R DB100.DBX2.7
R DB101.DBX5.1
WILL reset the addresses.
 
One more question is : If processor clear RLO after finish each rung (network)?



But I do know that it sets the RLO upon starting a new rung.

I'm not sure whether I'm getting mislead by the use of the term rung here and there may be a difference between STL and LAD/FBD in this respect (perhaps because of interaction with EN/ENO), but in STL the RLO is definitely not cleared at the end of a Network, nor is it cleared at the start of the next Network and I've got the scars to prove it!

I think this may be tied up with the problem with the RLO and Jumps in the 300 family, so the 400 may be different.

So in douyi's Reset example above if his list of Reset instructions is at the start of a new Network which he sometimes Jumps to and sometimes runs straight through to, from the previous Network, he could find it sometimes working and sometimes not.
 
I'm not sure whether I'm getting mislead by the use of the term rung here and there ..
Yes, I should have said "network" in stead of "rung".
Sorry, sorry.

I think this may be tied up with the problem with the RLO and Jumps in the 300 family, so the 400 may be different.
The 400 works exactly the same as the 300 in this respect.

But on to possible misunderstandings and how to avoid them.
If you want to clear or set some bits, then it is perfectly acceptable to start a network like this:
(start of new rung network)
R DB100.DBX10.0
S DB100.DBX2.7

But what if you at a later time copy the code into another place, and not thinking that it must be in the start of a network ?
Better is to ALLWAYS set the RLO before setting or resetting bools, wether in the start of a network or not:
(start of new network, or in the middle of a network)
SET
R DB100.DBX10.0
S DB100.DBX2.7
 
Simon is correct, network start/end has no influence on the RLO.

For a better explanation than I can give, search for 'First Check" or /FC in the S7 STL help.
 
You guys are absolutely correct.
A quick test verified that RLO is not dependant on network transitions.

Where have I got that idea from I dont know.
Good thing that I allways set or reset RLO.
 
It's hard to think the way S7 thinking, seems I've been washed brain by AB, but I've already seen something sparking of S7. I'm start loving STL, it gives me more power to do everything, and the only thing I have to pay more attention is the program style - this is more like an IDE.

Anything else for programming guide? tricky stuff?
 
The replies about the RLO not being dependent on the start of a new network are correct. The RLO status is controlled explicitly, however. If it weren't two ladder networks like this wouldn't work:




Network 1

A B
---| |------------( )---


Network 2

C D
---| |------------( )---



If the RLO wasn't explicitly controlled in some form the result of network 2 would be contingent on the result of network 1. We all know this is not the case.

It seems to be based on a nebulous thing called a 'code segment'. As near as I can tell a code segment is the logic between any two RLO-contingent assignments or jumps. For typical ladder programming the beginning of a network and the beginning of a new segment are effectively the same thing as the ladder editor won't let you 'dead-end' a rung. But in STL you can do pretty much anything you want relative to network transitions so it is a much greater concern there.

From what I could see the result of the RLO is forced to assume the state of the result of the first logical operation in a segment based on the state of the /FC bit.

Unconditional math networks before logic was causing me mental block until I relaized that either the logic was the first occurrance of logic on the function or it must have followed and RLO dependent assignment or jump somewhere along the line.

KEith
 

Similar Topics

Hi dear enthusiasts;), I am taking a PLC course where we use Festo PLC (FC660). I did some LDR programming before and not until recently I...
Replies
9
Views
6,735
Hello everbody out there. I have 2 topics actually I wanted to share and get your opinions about but since they are related I sum up in one...
Replies
14
Views
9,814
Hi I implemented a logging function in S7 STL and SCL both and both of them works as I wanted which is when I say log data, FC logs the number of...
Replies
2
Views
7,186
i am new to simatic manager and i am trying to figure what this part do in the code : A I 5.6 = DB50.DBX 4.6...
Replies
3
Views
128
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
205
Back
Top Bottom