Evaluate the AutomationView desktop suite free for 30 days. No credit card required. Claim trial key →
arrow_back Back to Articles

Inside AutomationView: Implementing IEC 60848 Macro-Steps

calendar_month
person Carvalho Raphael

Inside AutomationView: Implementing IEC 60848 Macro-Steps

AutomationView
%%{init: {'theme':'dark', 'themeVariables': { 'background': '#001c38' }}}%%
flowchart LR
    M1["Macro-Step (M1)"]:::blueNode --> T1["Transition"]:::grayNode
    T1 --> E1["Enclosure (E1)"]:::greenNode
    
    classDef blueNode fill:#2563eb,stroke:#1d4ed8,color:#ffffff
    classDef grayNode fill:#6b7280,stroke:#4b5563,color:#ffffff
    classDef greenNode fill:#16a34a,stroke:#15803d,color:#ffffff
AutomationView Icon AutomationView

Key Takeaways

  • Macro-steps hide sub-process complexity by encapsulating detailed expansions with strict single-input/single-output rules.
  • Enclosures manage hierarchical state, controlling the activation of subordinate sub-GRAFCETs dynamically.
  • AutomationView enforces these IEC 60848 rules natively, preventing race conditions in large-scale sequential logic.

When an automation project scales beyond a few dozen states, a flat Sequential Function Chart (SFC) or GRAFCET quickly becomes unreadable. Plant floor engineers frequently face the reality of spaghetti code where tracking a simple emergency stop state across 50 independent sequences feels impossible. To maintain modularity and deterministic execution, the IEC 60848 standard defines two structural concepts: Macro-Steps and Enclosing Steps (Enclosures).

The Structural Role of IEC 60848 Macro-Steps

An IEC 60848 Macro-step is an abstraction layer. It replaces a complex sequence with a single graphical block, represented by a double-line square. Under the hood, this block points to a distinct expansion chart.

The standard imposes a strict rule for execution: an expansion must contain exactly one input step and exactly one output step. The Macro-step becomes active when its preceding transition clears, immediately activating the expansion’s input step. The subsequent transition downstream of the Macro-step only evaluates to true once the expansion’s output step is reached.

flowchart TD
    S1["Step 1"]:::blueNode -->|Transition 1| M2["Macro-step M2"]:::greenNode
    M2 -->|Transition 2| S2["Step 2"]:::blueNode

    subgraph m2_expansion ["M2 Expansion"]
        E_IN["Input Step"]:::redNode --> E_T1["Internal Transition"]:::grayNode
        E_T1 --> E_OUT["Output Step"]:::redNode
    end

    M2 -.->|Activates| E_IN
    E_OUT -.->|Validates| S2

    classDef blueNode fill:#2563eb,stroke:#1d4ed8,color:#ffffff
    classDef greenNode fill:#16a34a,stroke:#15803d,color:#ffffff
    classDef redNode fill:#dc2626,stroke:#b91c1c,color:#ffffff
    classDef grayNode fill:#6b7280,stroke:#4b5563,color:#ffffff

Enclosures for Hierarchical State Management

While Macro-steps handle linear subroutines, Enclosures (Enclosing Steps) control hierarchy. An enclosing step acts as a master state. When active, it can forcefully activate or deactivate subordinate GRAFCET structures.

This is highly practical for handling operational modes. If an enclosing step defining Auto Mode is deactivated (for instance, due to a safety interlock), all enclosed steps are immediately neutralized. This prevents lingering active states that often plague poorly structured PLC programs.

Comparing the Structures

Choosing between these two elements depends entirely on the control intent.

Feature IEC 60848 Macro-Steps Enclosures (Enclosing Steps)
Primary Objective Encapsulating sequential sub-processes. Managing hierarchical states and modes.
Graphical Syntax Double-line square boundary. Large boundary physically containing child steps.
Execution Rule Strict one input, one output step constraint. Controls activation based on master step state.
Ideal Use Case Repeating logic (e.g., a standard clean-in-place cycle). Global safety stops or machine mode changes.

Implementing in AutomationView

AutomationView integrates these IEC 60848 elements directly into its core engine. Instead of manually writing boilerplate interlock logic, engineers can drag a Macro-step into the canvas and assign its expansion visually. The runtime engine natively handles the input and output step validation, flagging compilation errors if the strict structural rules are violated.

This validation catches race conditions before deployment, saving hours of debugging during commissioning.

Frequently Asked Questions

Can a Macro-step contain another Macro-step?

Yes. The standard permits nesting, allowing for deeply modular architectures. However, limiting nesting to three levels is considered best practice to maintain readability for maintenance technicians.

Do Enclosures override local transitions?

Yes. The state of the enclosing step supersedes the local transitions of its enclosed steps. If the parent falls, the children fall.

Optimize Your Sequences Today

Stop fighting complex state machines. Explore our pre-built templates and advanced sequence components to see these structures in action. Visit the AutomationView Store to upgrade your automation toolkit.

Share this article

Stay Updated with AutomationView

Get the latest articles and news delivered directly to your inbox.

Log in to Subscribe

You must be registered and logged in to manage subscriptions.

Recommended for you

Inside AutomationView: Using Python to Procedurally Generate Complex SFC Sequences

AutomationView
%%{init: {'theme':'dark', 'themeVariables': { 'background': '#001c38' }}}%%
flowchart LR
    A["Python Script"]:::blue --> B["AutomationView API"]:::green
    B --> C["Generated SFC / Grafcet"]:::red
    classDef blue fill:#2563eb,stroke:#1e40af,color:#ffffff
    classDef green fill:#16a34a,stroke:#166534,color:#ffffff
    classDef red fill:#dc2626,stroke:#991b1b,color:#ffffff
AutomationView Icon AutomationView
calendar_month

Inside AutomationView: Using Python to Procedurally Generate Complex SFC Sequences

Generating large, highly parameterized SFC (Sequential Function Chart) sequences by hand can quickly become a bottleneck in PLC engineering. Inside AutomationView: Using Python to Procedurally Generate Complex SFC Sequences explores how to eliminate manual drafting by utilizing the AutomationView Python API to script logic programmatically. The Paradox of Manual Sequence Design Modern machine builders often […]

Read Article arrow_forward

Inside AutomationView: Architecting Custom Python Simulation Models for Virtual Commissioning

AutomationView
%%{init: {'theme':'dark', 'themeVariables': { 'background': '#001c38' }}}%%
flowchart LR
    subgraph automationview ["AutomationView IDE"]
        SFC["SFC Logic"]:::blue
        PY["Python Sim Model"]:::green
    end
    subgraph execution ["Validation Environment"]
        SIL["Software-in-the-Loop"]:::purple
        HIL["Hardware-in-the-Loop"]:::red
    end
    SFC -->|Validates| PY
    PY -->|Exports| SIL
    SIL -->|Tests| HIL
    classDef blue fill:#2563eb,color:#ffffff,stroke-width:0px;
    classDef green fill:#16a34a,color:#ffffff,stroke-width:0px;
    classDef purple fill:#9333ea,color:#ffffff,stroke-width:0px;
    classDef red fill:#dc2626,color:#ffffff,stroke-width:0px;
AutomationView Icon AutomationView
calendar_month

Inside AutomationView: Architecting Custom Python Simulation Models for Virtual Commissioning

Commissioning industrial control systems on the factory floor is notoriously fraught with delays. Hardware arrives late, field wiring requires troubleshooting, and unexpected edge cases in PLC code only surface when mechanical components fail to behave as assumed. Virtual commissioning mitigates these risks, but connecting proprietary logic environments to dynamic physical models often requires complex middleware. […]

Read Article arrow_forward

How to Automate PLC Documentation Generation from AutomationView SFCs

AutomationView
%%{init: {'theme':'dark', 'themeVariables': { 'background': '#001c38' }}}%%
flowchart LR
    A["AutomationView SFC"]:::blue --> B["Python Extraction Engine"]:::green
    B --> C["Automated Documentation"]:::red
    classDef blue fill:#2563eb,stroke:#fff,stroke-width:2px,color:#fff
    classDef green fill:#16a34a,stroke:#fff,stroke-width:2px,color:#fff
    classDef red fill:#dc2626,stroke:#fff,stroke-width:2px,color:#fff
AutomationView Icon AutomationView
calendar_month

How to Automate PLC Documentation Generation from AutomationView SFCs

Key Takeaways: Manual PLC documentation generation is prone to errors and quickly becomes out-of-sync with production code. AutomationView allows engineers to auto-generate comprehensive specs directly from SFC (Sequential Function Chart) and Grafcet logic. Integrating Python-based extraction tools ensures a single source of truth for both code and technical documentation. The Challenge of Keeping PLC Specs […]

Read Article arrow_forward