{
"comment_snippet": {
"scope": "st",
"prefix": ["comment, snippet"],
"body": [
"/// Block description 2",
"/// $(1|place here the comment of method)",
"/// Return value: $2",
"${name:default}"
],
"description": "Add an Comment;"
}
}
Result:
{
"loop":
{
"prefix": ["loop"],
"scope": "st",
"body":[
"VAR_TEMP",
"\t index : ${1|INT,LINT|};",
"END_VAR",
"FOR index := ${1|INT,LINT|}#${2|0,1,X|} TO ${3:EndValue} DO",
"\t;",
"END_FOR;"
],
"description": "create a loop section with VAR_TEMP;"
}
}
Result:
Importing global variables into the VAR_EXTERNAL
section of a POU
Currently not productive; it might not always work
Further information: Documentation Link
In SIMATIC AX you can add comments to your methods or functions with ///
A complete overview of the shortcuts in VS Code
/AX Coce
you'll find here: VS Code shortcuts
Useful search&replace patterns when you want to migrate SCL Code (exported from TIA Portal) into ST:
Search field | Replace field | Example | |
---|---|---|---|
Remove all # for variables of a SCL source | #([A-Za-z]) | $1 | #statVariable --> statVariable |
Remove all { S7_SetPoint := 'False' ... } | {[A-Za-z0-9 :=';_.]*} | Bin2 { S7_SetPoint := 'False'} : "typeStatisticsBin"; --> Bin2 : "typeStatisticsBin" | |
Remove "name" | "([A-Za-z]*)" | $1 | |
TIA-Type to ST-Type | TYPE "([A-Za-z0-9_]*)" | TYPE $1 : | |
Remove " in type declaration |
"([A-Za-z0-9_]*)" | $1 |
thats's not a migration guide and it's still manual necessary. But it can make the life easier.
This workspace will be checked by the markdownlint-cli (there is also documented ho to install the tool) tool in the CI workflow automatically.
To avoid, that the CI workflow fails because of the markdown linter, you can check all markdown files locally by running the markdownlint with:
markdownlint **/*.md --fix
Please read the Legal information