Your cart is currently empty!

How to Create and Duplicate Alarm Subroutines in S7-200 SMART Using Step 7 MicroWin | HMI Alarm
When working with Siemens S7-200 SMART PLC, modular programming through subroutines is a key best practice โ especially when handling alarm logic. Creating reusable and easily duplicated alarm subroutines allows for scalable project design, efficient troubleshooting, and consistent HMI behavior.
In this guide, weโll walk you through:
- How to create an alarm handling subroutine in Step 7 MicroWin
- How to duplicate the subroutine for multiple alarm conditions
- How to integrate the logic with HMI alarm indicators
- A practical video tutorial you can follow via the official YouTube channel:
๐ฅ Weblog5me YouTube Channel
๐ What Is a Subroutine in S7-200 SMART?
In Step 7 MicroWin, a subroutine (SUB_xx) is a user-defined block of logic that can be reused multiple times from the main program or other blocks. Each subroutine helps:
- Improve code organization
- Minimize redundancy
- Simplify debugging and testing
For alarms, this means one universal logic block can handle multiple conditions like high temperature, low pressure, motor overloads, etc.

โ๏ธ Step-by-Step Guide: Creating an Alarm Subroutine
โ Step 1: Open Step 7 MicroWin Smart
- Launch your S7-200 SMART project
- Navigate to the Program Blocks section

โ Step 2: Create a New Subroutine in Siemens S7-200 SMART
- Right-click on Subroutines โ Add New Subroutine
- Name it:
ALARM_HANDLER

โ Step 3: Build Basic Alarm Logic
Inside ALARM_HANDLER
, implement the alarm logic, such as:
I0.0
: Input condition (e.g., temperature sensor fault)
M0.0
: Memory bit to trigger HMI alarm
You can also use SET/RESET coils for latched alarms.
๐ How to Duplicate Alarm Subroutines
โ Step 4: Copy the Subroutine Block
- Select
ALARM_HANDLER
โ Right-click โ Copy - Paste and rename it to
ALARM_HANDLER_2
,ALARM_HANDLER_3
, etc.
Each duplicate can monitor different inputs (e.g., I0.1
, I0.2
) and write to different memory bits (e.g., M0.1
, M0.2
).
โ Step 5: Call Subroutines in Main Program
- In the Main OB1, add
CALL
instructions for each subroutine:
This executes all alarm checks in each PLC cycle.
๐ฒ Link with HMI Alarm System
If you’re using a compatible HMI panel, map the M
bits (M0.0
, M0.1
, etc.) to alarm indicators or pop-ups using:
- HMI Tags (Bool)
- Trigger โ Message text display
- Acknowledge โ Reset Memory bit if required

๐ฅ Watch Step-by-Step Video
For full visuals and hands-on tutorial, visit:
๐ Weblog5me YouTube Channel
The video walks through the real-time subroutine creation, duplication, and HMI configuration from scratch using Step 7 MicroWin SMART.
๐ Expand Your PLC Toolkit with Downloads
Get downloadable tools, firmware, and software at:
๐ ๏ธ vohauipr.com โ Your source for Siemens, Rockwell, and automation resources.
Suggested download:
โก๏ธ Step 7 MicroWin SMART Trial Package
By mastering how to create and duplicate alarm subroutines in the S7-200 SMART PLC using Step 7 MicroWin, you can build reliable and scalable control systems that are easy to debug and integrate with HMI alarms. This method boosts programming efficiency and ensures consistent alarm handling across all your automation projects.
To take your PLC projects to the next level, explore downloadable tools and software packages from vohauipr.comโa trusted resource hub for industrial automation.
Here are 5 useful downloadable products to support your development:
๐ฆ Download Step7 MicroWIN SMART Software Trial
The essential programming software for S7-200 SMART PLCs. Ideal for beginners and experienced engineers alike.
๐ฆ RSlogix Rs5, RS500, studio5000 Rockwell automation software
Simulate your PLC programs before deploying to real hardware. Helps you test your alarm logic without risking a live system.
๐ฆ FTLogixEcho Trial Software V3.00.00
Perfect for configuring HMI screens and alarm messages linked to your S7-200 SMART PLCs.
๐ฆ Download Siemens LOGO! Soft Comfort V8.3
A great companion for small-scale alarm systems and logic testing before scaling to S7-200 SMART.
๐ฆ Download Siemens TIA Portal V15.1 Trial
Upgrade your development environment when working with newer Siemens controllers, while still applying similar alarm subroutine structures.
๐ Explore more at: https://vohauipr.com
Stay ahead in industrial automation with trusted software and expert tutorials!
Leave a Reply