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
NETWORKto one rung or action - split independent
MOV,TON,S,R, and output assignments into separate networks
- wrap OB1 logic in
- For V2.8, prefer the verified keyboard flow:
Ctrl+F1imports into the active block tabCtrl+F3exports the active block tabCtrl+F6compiles 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
.smartproject 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+F1andCtrl+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.
- AWL: assets/bag-pulse-dust-collector-4bags-ob1.awl
- Address and parameter notes: references/bag-pulse-dust-collector-4bags.md
Read When Needed
- For the bundled example logic and addresses, read references/bag-pulse-dust-collector-4bags.md.
- For encoding issues, block-name drift, active-tab import behavior, save prompts, and invalid networks, read references/troubleshooting.md.