Kkula
Browse Questions » STEP 7 / STEP 7 Lite: Where Towards place certain Algorithm

About User

Questions Asked: 37.9K

Answers Given: 32

0
  • Open

STEP 7 / STEP 7 Lite: Where Towards place certain Algorithm

I have M21.3 that is Set and Reset in over 20 different FC's.
I want to Set or Reset M21.2 whenever M21.3 is Set or Reset.
Is there one place I can write the logic so this happens accordingly, without having to Set and Reset M21.2 in each individual FC??
Thanks in advance....

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

Centralized Control of M21.2 based on M21.3

Yes, you can achieve this without modifying each FC individually. Utilize a Global Data Block (DB) and a dedicated Organization Block (OB) to handle the logic.

  1. Create a Global Data Block (DB): Define M21.2 within a Global Data Block (e.g., DB10). This makes it accessible from all FCs.
  2. OB1 or OB8: Implement logic in OB1 (cyclic execution) or OB8 (event-driven if reset needs immediate action) to monitor M21.3.
  3. Logic in OB1/OB8: Use a simple ladder logic or STL statement:
    • IF M21.3 THEN M21.2 := TRUE; ELSE M21.2 := FALSE; END_IF; (For setting M21.2 based on M21.3)
  4. Access M21.2: In your FCs, *read* the value of M21.2 from the Global Data Block (e.g., DB10.DBX0.0). Do *not* write to it directly within the FCs.

This centralized approach ensures M21.2 is consistently controlled based on M21.3, simplifying maintenance and reducing errors. Refer to the SiePortal for details on Global Data Blocks and OB configuration: Siemens SiePortal - Global Data Blocks and Siemens SiePortal - Organization Blocks

0