| name | s7-200smart |
| description | Use when working with Siemens S7-200 SMART or STEP 7-Micro/WIN SMART V2.8 on Windows, especially to import or export active blocks, compile with keyboard shortcuts, verify output-window results, repair AWL encoding issues, or fix subroutine display-name mismatches such as call errors after import. |
S7-200 SMART
Use this skill for STEP 7-Micro/WIN SMART V2.8 desktop automation on Windows.
Prefer attaching to an already-open MWSmart session instead of launching the software yourself.
Workflow
- Run scripts/find_open_200smart_process.ps1 to locate the visible V2.8 window.
- If the user needs a ready-made case, use the bundled AWL in assets/bag-pulse-dust-collector-4bags-ob1.awl.
- If writing or editing AWL, keep it LAD-friendly:
- wrap OB1 logic in
ORGANIZATION_BLOCK OB1
- keep one
NETWORK to one rung or action
- split independent
MOV, TON, S, R, and output assignments into separate networks
- For V2.8, prefer the verified keyboard flow:
Ctrl+F1 imports into the active block tab
Ctrl+F3 exports the active block tab
Ctrl+F6 compiles the project
- Treat success as a combination of:
- import or export output contains a success line
- compile output contains zero errors
- visible invalid network count is zero when LAD rendering matters
- Do not save or overwrite the
.smart project unless the user explicitly asks.
Verified V2.8 Rules
- Exported block files are plain
ANSI/GBK, not UTF-8.
- The active editor tab matters for
Ctrl+F1 and Ctrl+F3; tree selection alone is not enough.
- For subroutines, display name mismatches can break callers even when the block number is still
SBR15.
- If compile shows a missing-subroutine call and the output lists
SBR_15 (SBR15) instead of the expected Chinese block name, reimport a prepared ANSI file whose subroutine display name matches the intended block name.
Reusable Commands
Find the open V2.8 process:
& "$PSScriptRoot\scripts\find_open_200smart_process.ps1"
Capture the current 200SMART window:
& "$PSScriptRoot\scripts\capture_200smart_window.ps1" `
-OutputPath ".\mwsmart_window.png"
Read the output window:
& "$PSScriptRoot\scripts\read_200smart_output_window.ps1"
Prepare an AWL file for V2.8 import using local ANSI/GBK encoding and an optional subroutine display name:
& "$PSScriptRoot\scripts\prepare_200smart_awl_file.ps1" `
-SourcePath "C:\path\to\edited.awl" `
-BlockDisplayName "脉冲气动" `
-OutputPath "C:\path\to\脉冲气动.awl"
Export the active block with Ctrl+F3:
& "$PSScriptRoot\scripts\export_active_block_200smart_v28.ps1" `
-OutputPath "C:\path\to\故障报警.awl"
Import the active block with Ctrl+F1 and compile with Ctrl+F6:
& "$PSScriptRoot\scripts\import_active_block_and_compile_200smart_v28.ps1" `
-AwlPath "C:\path\to\脉冲气动.awl" `
-ScreenshotPath ".\mwsmart_active_block_compile.png"
Import the bundled OB1 example and compile it:
& "$PSScriptRoot\scripts\import_and_compile_200smart_v28.ps1" `
-UseBundledBagPulse4 `
-ScreenshotPath ".\mwsmart_v28_compile.png"
Import a custom OB1 AWL and compile it:
& "$PSScriptRoot\scripts\import_and_compile_200smart_v28.ps1" `
-AwlPath "C:\path\to\your.awl" `
-ScreenshotPath ".\mwsmart_v28_compile.png"
Bundled Case
Use the bundled four-bag pulse dust collector example when the user asks for a default working program.
Read When Needed