Siemens STL Logic to Jump for a Bit !?

But cgehlhausen's case would be the same if you replace the 'R #At_Break_Vel' in my example with 'A "Bit1" JC Task1' from cgehlhausen's example. The 'A "Bit1"' would AND with an RLO of zero and the jump wouldn't occur.

cgehlhausen never said that the logic he is having trouble with was the first thing in a network, in which case the RLO is taken care of. If this JC occurs in the middle of a network with preceeding logic all bets are off, at least in an S7-3152DP.

Keith
 
On a slightly different note, wouldn't cgehlhausen be better off using the JL (jump to labels) instruction? It seems more closely aligned to what he wants to do.


Keith
 
It was the SET command that was needed - A lot less code needed now. The 314C-2PtP must be another CPU that has funky commands.

It's a Compact model, meaning it has digital and Analog I/O built in, plus the PtP means it has an extra Serial port.
 
Can you please confirm that it was not the code preceding your posted logic that caused your problem ? Can you post this code snippet as well ?
 
Originally posted by SimonGoldsworthy:

Can you please confirm that it was not the code preceding your posted logic that caused your problem ? Can you post this code snippet as well ?

I think that is exactly the issue. It IS the code preceeding the logic that is causing the problem.

For those who don't usually work with STL in S7 processors, the idea that logic you placed in a network can still influence you after you have used that logic for it's intended purpose is a bit counter-intuitive. With plcs in ladder logic, as soon as you perform an action and end a rung you move on and start from scratch. This is not necessarily true in STL. The state of the RLO is valid and is used in all logic calculations until a new network is started.

This is really no different than in ControlLogix where you can put an output condition in a rung and then continue with more logic. The difference is that in ladder the visual clues indicate that your logic after the output is contingent on the logic preceeding that output, or more correctly, on the state of the output itself. Without the visual clues in STL is is easy to forget about the RLO if you don't intend to use it.

Keith
 
Peter Nachtwey said:
This will work of the bits are grouped together.
First you must find the bit index.
( Has anyone figured out to do this efficiently yet? )
Then use the JL instruction to jump to the desired code.


I would also use the JL(Jump to List)-instruction combined with some kind of homemade "Bit-to-int"-conversion.
 
Difference between 300 series and 400 series CPUs

Without seeing what other code is involved, it's difficult to be sure, but this sounds very much like the old problem caused by the different processors used by the 300 and 400 CPUs. Since I believe S7Guy usually works with 400 CPUs, it would explain why he's never seen the problem. Almost everybody who works with 300s on a regular basis has almost certainly had this problem (possibly without necessarily knowing why!).

Here is The Siemens Explanation.

Edit:
I tried to bookmark the explanation, but for some reason it doesn't work. The post concerned is the first FAQ in the list - "FAQ Why do STEP 7 programs behave differently with respect to the BR bit with SIMATIC S7-300 and S7-400? ".
 
Last edited:
The problem is that in the 300 series the jump doesn't close off the logic chain and reset the "first query" bit, so that after your jump you are not starting a new evaluation, but instead continuing an existing evaluation chain.
 
Roy-

So based on what you and S7Guy are saying, the 400 series processors DO cclose the logic chain at a jump? I've never used the 400 series. I just assumed they would act the same as the 300 series in this case.

Keith
 
Unfortunately the Siemens explanation is not a miracle of clarity (not helped by the fact that they apparently have a typo in their example: neither
O M0.0
O M0.0
= M0.2
nor
A M0.0
O M0.0
= M0.2
are particularly sensible!), but the one thing that is 100% clear is that the 300s and 400s respond differently under these conditions - the 400 series behaving as one would logically expect.
 
I think the only problem here is that you are using more than 4 signs in your labels (task1). You shoult rather call them something like: tsk1, tsk2, etc...
 

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
690
I'm having trouble trying to convert this code to ladder, anyone able to help me? A M4.0 A M4.1 A M117.0 AN M17.7 A ( A I38.6 AN I3.7 O ( A M4.5...
Replies
8
Views
1,211
Hello, I am still new to STL. But from what I understand is the JC mnemonic should jump if RLO = 1. If we review both pictures the M0bf RLO = 1...
Replies
5
Views
1,059
Hello, I am working on a project to upgrade some old S5-100U processors. The programs are all uploaded and I don't have descriptors...ugh. Be that...
Replies
4
Views
1,177
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,232
Back
Top Bottom