Kkula
Browse Questions » STEP 7 / STEP 7 Lite: Information Code block Entry Within Step7

About User

Questions Asked: 37.9K

Answers Given: 32

0
  • Open

STEP 7 / STEP 7 Lite: Information Code block Entry Within Step7

I am working on a project in which many of the FC/FBs need continual access to external data blocks,rather than input/output parameters(due to the architecture of the program.)
I'm looking for a description of how a Step7 FB/FC manages the address registers while accesses data blocks. I can't seem to find this in the general user documentation.
Any help would be appreciated.
Thanks

0 Likes 0 Favourites 0 Followers 0 Comments
Answers(1)

Data Block Access in Step 7 FB/FCs

Function Blocks (FBs) and Function Codes (FCs) in Step 7 access data blocks using a dedicated memory area for static and temporary data. When an FB/FC needs to access data within a data block, it doesn't directly use input/output parameters for all data, especially for persistent data.

How Address Registers are Managed:

  • Static Data: Data declared with the STATIC attribute within an FB/FC is stored in the FB/FC's instance data block (DB). This DB is created when the FB/FC is first called. Access to static data utilizes the address registers managed by the Step 7 runtime environment.
  • Temporary Data: Data declared without the STATIC attribute is temporary and exists only during the FB/FC's execution. It's stored in the FB/FC's working memory.
  • Data Block Access: When referencing data in external data blocks (DBs), the FB/FC uses the DB number and data address (e.g., "DB1.DBX0.0"). The Step 7 compiler resolves these addresses during configuration, and the runtime system manages the memory access.

Key Considerations:

  • Avoid excessive use of static data, as it increases memory consumption.
  • Optimize data block access for performance.

For detailed information, refer to the following resources within SiePortal:

0