S7 functions

I wonder if somebody could explain to me the difference between function blocks and function calls.
Thanks

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Bob Watkinson wrote:

http://www.google.com/search?q=function+blocks http://www.google.com/search?q=function+calls
Jerry
--
Engineering is the art of making what you want from things you can get.

  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Kinda hoping for a short definative reply rather than having to trawl through 26 million or so pages looking for a difference. Thanks anyway.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Bob Watkinson wrote:

http://www.functionblocks.org / Lisp: http://www.supelec.fr/docs/cltl/clm/node61.html C, C++: http://www.msi.umn.edu/sp/sp_manuals/cc++/doc/language/concepts/cuexpfun.htm
Jerry
--
Engineering is the art of making what you want from things you can get.

  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

A S7 or PLC Open function has no state. It uses only the parameters. For instance, a sine or cosine function only care about the angle. When implemented all the parameters are pushed on the stack and a value is returned in the accumulator or stored using a pointer. However, all the data that is pushed on the stack is "popped" off so the function starts with all new parameters the next time it is executed.
A S7 or PLC Open function block has state. A PID would be a function block because it must keep track of the errors and integrator state. This means that each instance of a FB must be declared or allocated in some way because each instance of a FB has it's own copy of "static" variables to hold the state. In the case of a PID, each PID would need to keep track of its own integrator and error history.
A function block is like a C function with a pointer to static variables.
Peter Nachtwey
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

thanks Peter
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.