/matteo-siemens:tia-portal-scl-blocksfrom matteo-siemens
Crea, modifica e compila FB, FC e DB in SCL per Siemens TIA Portal, anche safety (F-Program). Usa per qualsiasi codice PLC Siemens.
Ships in matteo-siemens. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This skill guides the correct structure, variable declarations, and compiler constraints for creating Siemens S7-1200/S7-1500 blocks (FBs, FCs, DBs) in Structured Text (SCL) for TIA Portal.
TIA Portal SCL has strict rules for block declarations. Variable sections must be declared in the block header (before BEGIN) and closed with END_VAR.
VAR_INPUT ... END_VAR (Input parameters)VAR_OUTPUT ... END_VAR (Output parameters)VAR ... END_VAR (Static variables - FBs only)VAR_TEMP ... END_VAR (Temporary variables)VAR CONSTANT ... END_VAR (Local constants)[!IMPORTANT] Syntax Rule for Constants:
- Use
VAR CONSTANTwith a space. WritingVAR_CONSTANTwith an underscore will fail compilation!- Always close the constant block with
END_VAR. Never useEND_CONSTANT! If the constant block syntax fails, TIA Portal will reject the entire block interface, leaving all block parameters blank.
FUNCTION_BLOCK "FB_MyCustomBlock"
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR_INPUT
i_Enable : Bool;
END_VAR
VAR_OUTPUT
o_Status : Bool;
END_VAR
VAR
stat_State : Int := 0;
END_VAR
VAR_TEMP
temp_Trigger : Bool;
END_VAR
VAR CONSTANT
STATE_IDLE : Int := 0;
STATE_RUNNING : Int := 10;
END_VAR
BEGIN
// Block code here...
END_FUNCTION_BLOCK
To create a global DB via SCL source code:
DATA_BLOCK "DB_MyGlobalData"
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
NON_RETAIN
VAR
MyVariable1 : Bool; // Comment
MyVariable2 : Int; // Comment
END_VAR
BEGIN
END_DATA_BLOCK
When exchanging data between standard SCL logic and failsafe F-Programs (F-FBD/F-LAD):
[!WARNING] Strict Siemens Safety Compilation Rule: In the F-Program, any single variable in a standard DB (e.g.,
"DB_SafetyBridge".MyVar) can be either read or written, but never both. Failing this rule triggers aConsistency Checkerror.
#statMyVar). Assign this local variable to the standard DB tag in a parallel/terminal write assignment.#statMyVar) instead of the standard DB tag for all internal logic networks.VAR_CONSTANT instead of VAR CONSTANT (with space): TIA Portal SCL strictly requires a space. An underscore will break block interface compilation.END_CONSTANT instead of END_VAR: Always close the constant block with END_VAR. Writing END_CONSTANT will cause the compiler to flag the BEGIN keyword as invalid and fail.#stat...) instead.[!IMPORTANT] Check before saving: Always verify that there are no occurrences of the word
END_CONSTANTorVAR_CONSTANT(with underscore) in your generated SCL files before writing them!
[!IMPORTANT] Workflow di Importazione in TIA Portal: Su TIA Portal, i blocchi SCL vengono importati tramite "Sorgenti esterne" -> "Aggiungi nuovo file sorgente esterno" (Add new external source file) e compilati cliccando su "Genera blocchi da sorgente".
Regola Operativa per l'LLM: Ogni volta che si crea o aggiorna un blocco SCL (FB, FC, DB), l'LLM DEVE:
- Salvare il file
.sclstand-alone ESCLUSIVAMENTE all'interno della cartella dedicatasiemens_blocks/nella root di progetto (es.<workspace_root>/siemens_blocks/<NomeBlocco>.scl).- NON disperdere file
.sclnella root del progetto o nelle sottocartelle VCI.- Fornire all'utente il link cliccabile al file in
siemens_blocks/affinché l'utente possa copiarlo o importarlo a mano in TIA.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub aliasmb/matteoskills --plugin matteo-siemens2 skills in this plugin