What I've always wanted to know in S7 (but never dared ask)

Johnny T

Member
Join Date
Jul 2003
Location
Fife, Scotland
Posts
642
Hi,

A couple of questions that I've thought of concerning Siemens S7. Probably a few of them are simple questions that really I should know the answer to, but.. as they say, no-one is born with knowledge. If you could answer any or all of them it would be really appreciated...

1) In the program elements list in Ladder, why do we have a 'coil' version of things like counters and timers, and also a 'full' version, ie. a block that you can fill in all the inputs to? Why not just have the block? What's the advantage of just using the coil version (if any) ?

2) In S7, what percentage roughly of things can be achieved just with Ladder. ie. is it really necessary to use STL or is this just a throw back to S5? Or is it that 95% of things can be achieved in Ladder but we just need STL for things like Pointers? (I'm not sure if you can use pointers in Ladder - although I suppose you could with the Double Word elements)

3) In a Data Block, if an address is assigned as a Data Type of 'array' ie.
 DB1
Address +32.0 ARRAY[1..34]
WORD


How are those words addressed? Are they addressed as DB1.DBW32 up to DB1.DBW98 ?? If so, why use an array?

4) Why in S7 when giving a Timer its time-base do we use S5T#1S for 1 second. S5T in the help file comes up as S5 Time. Is there not an S7 Time? If so, how is that written?

5) In Data Blocks when we declare a Data Type to be an INT why don't we just use Words. I know an INT is any whole number, but declaring an address as a Word allows us to store a whole number in it so why the need to specify INT??

There are probably more questions I have but, as its Monday morning, I'll leave it there for now.

Any answers gratefully received...

Cheers

JT
 
I would answer to the the third question



if db1 is called for example settings and the array is foe example hi_setpoint

u can call this in your program as

l settings.hi_setpoint[1]

and if you have 34 device that each has a different hi_setpoint this way is much easier
 
Amr Hassan

Thanks for the answer. So, am I right in thinking the next value in that array would be settings.hi_setpoint[2] ? It wouldn't jumped up in 2's like it does for addresses would it?

Cheers

JT
 
As far as question 4 is concerned, I assume that the S5T timer is a hangover from S5 days, for compatability purposes. I guess you could say that the IEC timers are the S7 timers.
 
for the s5t in s5 you had to decide the time base for the timer .
now in step 7 with this instruction the time base is automatically selected according to the time setting
 
1) I don't use LAD, so I'm not sure about this, but I'm guessing it's because someone may want to use some timer or counter elements throughout the program. You could set a timer in one place, and reset it in another.
2) There are quite a few things you can do in STL that is not possible in LAD. Also, STL code runs much faster and is quicker to write code for. Unless it is a simple project with mostly boolean instructions, STL should definitely be part of a program.
3) Arrays are very useful. The best thing would be for you to look at some of the other threads and see some of the array applications.
5) In many cases, you can, but why would you? Isn't it easier to enter and read "31" instead of "1F"? Also, ints are signed, so we can have pos and neg values.
 
Johnny if you fully installed the Simatic software you should be able to goto Simatic>S7 Manuals>Systems and Standard Functions for S7300 and S7400. The name of the pdf file is S7SFC_B.PDF.

Chapter 20 of this manual explains the IEC timers and counters. I believe they are called that because they conform to IEC 1131-3.
 
Found that manual thanks. Had a look at it and it seems that you need to call an SFB in order to utilise the IEC timers.

Think I'll just stick with S5T's for now, but always handy to know.

Thanks again

PS. You're right.. the IEC timers are so called because they comply with IEC 1131-3 standards. :)
 
IEC Timers are the relatively basic timers defined in IEC6113-3. You'll find them in the Standard Library under the System Function Blocks folder, they are:

SFB3 TP //Simple Impulse Timer
SFB4 TON //Delay ON Timer
SFB5 TOF //Delay OFF Timer

Highlight the SFB and hit the F1 key to pull up the Help file with the full description.
 

Similar Topics

hello I have 7cp476 cpu why can led always open and No connection
Replies
1
Views
131
I have a program that I am gradually piecing together (my first program). There are 4 cascading timers that turn Y001 and Y001 + Y002 on and off...
Replies
8
Views
542
So I've been told time and time again that a PID (or PIDE) instruction should never be conditionally enabled/disabled and the only thing that...
Replies
7
Views
678
Found this online :hmmm: Kind of funny :) We use "Always Off" for Dummy Code to Monitor tags in the ladder to avoid [AFI]'s from throwing...
Replies
17
Views
2,991
It seems that the OPs always want to be secretive. Not just on this forum but also on reddit/control theory and especially on a Chinese forum we...
Replies
40
Views
9,873
Back
Top Bottom