S7 STL - Can somebody explain what this is supposed to do?

RMA

Member
Join Date
Sep 2004
Location
North of Hamburg, Germany
Posts
2,052
While examining the STL code generated by an S7-GRAPH program I noticed the following code for handling the Supervisions.

GRAPH.JPG


As you can see, after testing the Supervision criterion, if it's not satisfied, the number of the supervision is loaded, but then the program just carries on and loads the data for the next criterion. This carries on all the way down the supervision list.

In a four accumulator CPU, this would mean that in AKKU3 you could find the number of the last Supervision which was not satisfied, but in a two accumulator machine, like most of the 300s (I assume the 318 is an exception) you would have lost this value.

Or is there something clever you can do to retrieve it, which I don't know about?
 
What about the BE instructions ? these are block ends so the program does not flow as you describe, it ends after the crtierion test. My guess is that the siemens FC that supervises the Graph peeks at the MC7 code (using the stack etc) to get the number 94. (If this was Step5, it was documented how to get at the MC5 code within a block - I've yet to see this in Step7)
 
Last edited:
What about the BE instructions ? these are block ends so the program does not flow as you describe, it ends after the crtierion test.



Yes, but the BE occurs only if the Supervision criterion is satisfied, which will normally not be the case, so the program will flow on through and load the Supervision number. For example, in both Networks, the General Fault Bit is tested, and in NW298, (V95) this is OR'ed with the 6 second travel time of the motor driven switches.

The result is that in a four accumulator machine, if one of the Supervision criteria becomes true, you've got the number of the last "good" Supervision test in AKKU3 (what they want to do with it is anybody's business), but in a two accumulator machine, you've lost it - or is there some way to retrieve it?

I'm afraid I've got to go now, got a 100 mile drive back home. Have a good weekend, see you all on Monday. Maybe somebody will have solved the puzzle by then!:)
 
Roy

What PLC are you using? I thought you were using a 318.

The only thing that I can think of is that before the contents of ACCU2 are written over, you 'POP' it back into ACCU1. Would that be any good to you?

Paul
 
I would agree if they were BEC instructions, but they are BE instructions which are not RLO dependant !
Ouch!!! Evidently I'm in dire need of the week's holiday I've got booked for next week. In my defence I can only offer the fact that I always use BEU and never use BE, so I managed to confuse myself thoroughly! Funnily enough, in most of the rest of the program, where every network (representing a Step in GRAPH) terminates with BE, I followed it no problem, I only got confused in this bit with the Supervision handling, weird!

Paul, it's the 317-2 DP that I'm using for this project. It's almost comparable with the 318 in power and memory for only 2/3 of the price, but still has the normal 300 Series architecture.
 
Roy, in the code that you posted, the "L 94" and "L 95" are never executed, so I'm wondering if it is a problem with the way it is converted over to STL representation from S7-Graph. I know that code written in SCL does not always display correctly in STL, so maybe S7-Graph has the same limitation, where it has additional instructions that STL does not support.

One thing you could check is the accumulators of the calling block right after it returns from this block. Do you ever see a 94 or 95?
 
I wasn't really looking at this, I just couldn't understand what was going on. I was actually hoping to find a clue to how the ALARM_S SFC functioned, since I'd turned the alarming on in GRAPH (and it works, too), but I couldn't find any reference to it in the program.

If I get a chance, I'll have a look, but at the moment getting my ALARM_S working has a higher priority! I think this is going to be a new Thread tomorrow!
 

Similar Topics

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
137
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
211
Hello nice to meet you, im new in here, I'm currently trying to convert code written in STL for a S7-400 to SCL for an S7-1500, because when i run...
Replies
5
Views
331
First off thank you in advance. Second I am very new to STL. I am trying to build a counter that has one count up and 23 count down options. Am...
Replies
6
Views
384
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
Back
Top Bottom