100% found this document useful (1 vote)
139 views

Function (FC) and Function Block (FB) Similarities/Differences in Siemens PLC-S7 Programming

This document summarizes the key similarities and differences between functions (FCs) and function blocks (FBs) in Siemens PLC-S7 programming. It notes that FBs have instance data blocks for saving parameters, can be programmed in GRAPH, and require instance data blocks when called. FCs do not have instance memory and all actual parameters must be filled. It also lists similarities like using TEMP variables, ENO execution feedback, and EN enable parameters. The document provides a tip to use TEMP variables instead of global memory in FCs to avoid inaccurate execution.

Uploaded by

anacer55
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
139 views

Function (FC) and Function Block (FB) Similarities/Differences in Siemens PLC-S7 Programming

This document summarizes the key similarities and differences between functions (FCs) and function blocks (FBs) in Siemens PLC-S7 programming. It notes that FBs have instance data blocks for saving parameters, can be programmed in GRAPH, and require instance data blocks when called. FCs do not have instance memory and all actual parameters must be filled. It also lists similarities like using TEMP variables, ENO execution feedback, and EN enable parameters. The document provides a tip to use TEMP variables instead of global memory in FCs to avoid inaccurate execution.

Uploaded by

anacer55
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/283170347

Function (FC) and Function Block (FB) Similarities/Differences in Siemens PLC-


S7 programming

Research · October 2015


DOI: 10.13140/RG.2.1.2951.4961

CITATIONS READS
0 8,219

1 author:

Shervin Ehrampoosh
Kettering University
12 PUBLICATIONS   36 CITATIONS   

SEE PROFILE

All content following this page was uploaded by Shervin Ehrampoosh on 26 October 2015.

The user has requested enhancement of the downloaded file.


Shervin Ehrampoosh
Patti Engineering

Function (FC) and Function Block (FB) Similarities/Differences in Siemens PLC-S7 programming:

Differences:

1- Memory: FC has no instance memory, while FB has an Instance Data Block (IDB). This IDB
saves all IN, OUT, IN_OUT and STAT parameters. They are accessible even after execution of
the relevant FB.
2- Programming Language: You can program FC or FB with FBD, LAD, STL and SCL
programing languages, while just FB has the capability to be programed in GRAPH.
3- Calling: FB call should be along with its instance data block. Otherwise, there will be question
mark “?” at the top the FB with no possibility to save or download to the processor. There is not
such a necessity in FC.
4- Filling Actual Parameters: If there is an FC call, all Actual Parameters should be filled in
with an address, since all Formal Parameters in FC do not save in any memory and as a result
there are no initial values assigned to them. In FB, you can leave any of the Actual Parameters
with no address. If you do not fill out all FC addresses, there is no possibility to save or download
the program.

Similarities:

1- We can define TEMP variable in both FB and FC.


2- In FBD/LAD, you will see an ENO as the result of the FB/FC execution. If it is a logical one, it
means that FB/FC has been run with no problem.
3- You can activate EN as enable for the FC/FB in LAD or FBD to make a conditional execution.
4- The possibility of using all Formal Parameters, IN, OUT, IN_OUT.
5- There is always a limitation for the number of Nesting Depth in FBs and FCs, refer to the CPU
data sheet. They are usually 16 for the new S7-300 processors, like CPU 317-2 PN/DP.

Tip:

In FC programming, if you do not want to use the results of the FC subroutines outside of it, it is
always a good idea to use TEMP variables, instead of Memory Bits (M) or Data Blocks (DB).
This is because of the possibility to call those M or DB addresses outside of the FC, results in an
inaccurate execution for the FC. Overall, programmers do their best not to use Global
variables in FCs.

View publication stats

You might also like