S5 project interpretation

Paullys50

Lifetime Supporting Member
Join Date
Jan 2006
Location
WI
Posts
2,188
Got a machine running Siemens S5, that has issues. I'm struggling with the STL logic.

This is just a portion, just wanting to clear some things up, and make sure I'm reading it right before I get too deep in this 3" binder of code we have for the machine.

segment 1...My Interpretation

0000 :C DB 123...Call Data Block 123
0001 :L DW 10 ...Load Data Word 10 from DB 123, put into Accu 1
0002 :L KF + 10..Load constant KF(what is kf?) + 0 into Accu2 ................ (Or does that write over the previous Accu1?)
0004 :!=F .......Compare accu1 and accu2 if equal RLO = 1
0005 := F 151.0..F151.0 is set to 1. Is this just a memory address? Flag? Whats the Diff?
0006 :
0007 :A I 31.7...Input 31.7
0008 :S F 151.1..Set F 151.0 to 1 when I 31.7 is pressed.
0009 :*** end of segment.

I'm mainly unsure of the loading of Accu1 and Accu2. And what exactly is going on with the calling of DBs and loading of DWs.
 
Last edited:
There can be up to 255 data blocks. DB0 is usually reserved for S5 use.
A data block normally consists of data words 0-255 (it can be smaller) It can be bigger but lets keep things simple for the moment.
This was just the way Siemens decided to provide data storage - you decide where the data is, call the DB and operate on the data until you need to operate on data in another data block.

Loading a number will first copy accu1 to accu2, then load the number into Accu 1 (Note some CPU's have 4 accumulators).

The KF is 16 bit integer format (KG is floating point format for example)

Flags are global memory (i.e. you don't need to call a data block to use them)
 
Paully's5.0 said:
.... I'm struggling with the STL logic..
Try this site, the S5 software will convert STL to ladder, they have a demo that you can try, some STL just will not convert, but some will it may help, BTW you will like STL when you get the hang of it :D
http://www.process-informatik.de/


There is a S7 conversion on the Siemens training site go to App. III on the bottom of this page, like I said its S7 but it may help http://www.automation.siemens.com/fea/html_76/down_module.htm


http://www.process-informatik.de/
 
SimonGoldsworthy said:
Loading a number will first copy accu1 to accu2, then load the number into Accu 1 (Note some CPU's have 4 accumulators).

then if I load another number, the first number from Accu1 moves to Accu2, and the new number loads into Accu1 correct?
 
Paully's5.0 said:
then if I load another number, the first number from Accu1 moves to Accu2, and the new number loads into Accu1 correct?

That is correct.

I will just add that compares are done as ACCU2 to ACCU1, in your example you have a "compare for equal to", that is 'Is ACCU2 Equal To ACCU1'.

You might have known that, but it didn't hurt to state it.
 
Thanks alot for the help!

Here is another one for you:

Segment 1
Name : DB-KOP
Decl :QUDB
Decl :QUDW
Decl :ZIDB
Decl :ZIDW
Decl :LAEW

Now, it looks like these are variables which have been assigned a value previously in the program. I see the DB and DW, so I'm thinking Data Block, Data Word, but what are the prefixes? Does QU mean the source DB, source DW, and ZI Destination DB,DW?

LAEW? Got nothing.

The program is suppose to be able to transfer recipies, right not that function is not working. I've found the DB/DW where the new recipe values reside, and I have found the DB/DW where the running recipe values reside, but I need to find out why the new recipe values are not transferring/overwriting the running recipe values.
 
I assume that what you have posted above has come from the first line of a Function Block (FB), what you have there is the declarations of the Inputs and Outputs of the function block, to see what these actually refer to you will need to find the call to the function block in the program, search for BD-KOP.

The names you see do not refer to anything in particular, they are names assigned to the various F/I/O and DB's ect that are used within the FB.

Paul
 
Last edited:
What Step 5 software are you running? I see the following using Siemens Step 5.
The first field is the Parameter Name, the second is the Parameter type and the third is the data format

Step5.GIF
 
Looks to me to be a copy function.

Segment 1
Name : DB-KOP
Decl :QUDB
Decl :QUDW
Decl :ZIDB
Decl :ZIDW
Decl :LAEW


QU and ZI would be source and destination (have no idea which is which) and LAEW = Length.
 
EXPLODE TO 3 SEGMENT LIKE THIS
:C DB 123...Call Data Block 123
:BLD 255
:L DW 10 ...Load Data Word 10 from DB 123, put into Accu 1
:L KF + 10..Load constant KF(what is kf?) + 0 into Accu2 ................ (Or does that write over the previous Accu1?)
:!=F .......Compare accu1 and accu2 if equal RLO = 1
:= F 151.0..F151.0 is set to 1. Is this just a memory address? Flag? Whats the Diff?
:BLD255
:A F 151.0
:A I 31.7...Input 31.7
:S F 151.1..Set F 151.0 to 1 when I 31.7 is pressed.
:*** end of segment.
AFTER THAT YOU CAN SEE THEM IN LAD OR FUP
 
Paully's5.0 said:
Thanks alot for the help!

Here is another one for you:

Segment 1
Name : DB-KOP
Decl :QUDB
Decl :QUDW
Decl :ZIDB
Decl :ZIDW
Decl :LAEW

Now, it looks like these are variables which have been assigned a value previously in the program. I see the DB and DW, so I'm thinking Data Block, Data Word, but what are the prefixes? Does QU mean the source DB, source DW, and ZI Destination DB,DW?

LAEW? Got nothing.

The program is suppose to be able to transfer recipies, right not that function is not working. I've found the DB/DW where the new recipe values reside, and I have found the DB/DW where the running recipe values reside, but I need to find out why the new recipe values are not transferring/overwriting the running recipe values.
It looks like one of typical blocks used by guys I've met some time ago. I think parameters for this block are:
QUDB - source DB
QUDW - source DW (start address of source area)
ZIDB - destination DB
ZIDW - destination DW (start address of destination area)
LAEW - length of area to be copied from QUDB to ZIDB in words.
 
I think gregoryg's probably right here, QU could be an abbreviation of the German QUELLE = Source and ZI and abbreviation of ZIEL = Target or destination. LAE would also fit for LÄNGE = length - the A-Umlaut (Ä) is written as AE where Umlauts are either not available (on the keyboard) or not permitted (as is probably the case here).
 

Similar Topics

Hi all, I am doing a project for GM and in the specifications it states: Logic shall be developed in SFC fashion and written in ladder logic...
Replies
20
Views
6,753
I have a project in panelbuilder32, and I want to put a password to secure the project from uploading to other people computers
Replies
1
Views
53
Hello all, I am currently facing a problem with a Pro-Face HMI PS5000 project file download. I have tried using GP-ProEX SP1 (4.09.350) and...
Replies
0
Views
63
Hello all! So I have one project with a S7-1214 and a MTP1500 "Project1" and one project with another S7-1214 "Project2". Both of these PLC:s need...
Replies
6
Views
166
Hi All, Someone at work has put a PLC system on my desk, that's just been taken off an idle production line. He said "It's an S7 PLC. We don't...
Replies
10
Views
325
Back
Top Bottom