Siemens S7 Programming for Dummies

  • Thread starter FrustratedFemale
  • Start date
F

Thread Starter

FrustratedFemale

I specialize in SCADA programming and have a good knowledge of PCS 7, BUT HELP!!! I'm Lost I started a new project on S7 and have no clue as to where to start! Worked through Getting Started manuals, need more info! Where can I get sample blocks and program applications? PLEASE HELP!
 
C

curt wuollet

Welcome to the much revered S7 world. This is the standard first reaction. Don't worry, it'll get worse. It helps to know assembly and raw computers in general, but the best I can suggest is to get a small program or two and see how it is used. I had to do that on a large program of typically byzantine complexity and a smaller, simpler one _might_ have been a little better. If you have programmed other PLCs, it doesn't work like them, but they do the same thing in vaguely similar ways. The manuals and tutorials read about the same in English and German. I wouldn't waste too much time on them. They really do need a "S7 programming for geniuses" book written by someone from the real world. A good text on X86 assembly language might be a start. Segmented addressing and pointers help prepare you for the experience. But programming raw processors is more fun.

Regards,
cww
 
F

FrustratedFemale

Thanks for the tips! Got some code from other projects. Seems ok especially now that I got my head around OB's,FB's and the dreaded STL!!! When do you use FC's instead of FB's though? The other engineers here seem to think using FC's is much better? Why? In PCS7 I used to use FB's with shared DB's. Isn't that more structured?

How does pointers work, is their something in the manuals about pointers that I might have missed?
 
FCs are for subroutines which process the parameters and return a result, but have no permanent state. For example, an FC might do a calculation on a couple of parameters and return the answer.

FBs are for all other applications. A typical program will have numerous FBs, but may have no or only a few FCs. There is of course nothing to prevent you from doing whatever you want, but that is the intent.

I won't attempt to explain pointers as that is such a big topic. The subject is documented somewhere in one of the Siemens manuals.
 
SIEMENS calls FCs as functions and FBs as function blocks. In S5 PLCs FBs have two main purposes:

1. For "Repetitive functions" used as sub-routines (all motors have one generalized FB and you pass on the variables/parameters to that FB, when you make a call in your program) and

2. For "Special STL commands/calls", which you are normally not allowed to use them in other blocks (PB, OB, SB Etc)

Pointers on the other hand are used mainly for indexing, for iterations/loops and this technique is very useful when you are implementing complicated logics. Pointers give a direct access to memory locations (a data word in a DB) and you can manipulate them very easily. Shared DB is a very useful technique, wherein two or more FCs share one memory area (say one DB).
 
F

FrustratedFemale

Hi Guys!

Thank you for all the tips, will be looking at a few more stuff and then start the basis of my project.
 
J

Jan Steen Nielsen, Denmark

Hello dear "Dummy"

Please mail to me and I will give you the best help anybody can give you by sending you a small very useful program, supported with my instructions.

As you already know by now, Siemens operate only in subroutines, FC or FB, where FCs are normal program-calls without memory, while FBs has its own memory with input/output features.

Send me a note, because I like to help you as a retired engineer - why not?.

Kindly regards
Jan Steen Nielsen
Denmark
L-N [at] mbox301.get2net.dk
 
Top