Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions UDL-samples/Siemens-AWL-STL_byLudborg.awl
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
FUNCTION_BLOCK "MotorControl"
TITLE = Simple motor start/stop with feedback monitoring
//Sample file for the "Siemens AWL" UDL (STEP 7 STL source, German mnemonics)
AUTHOR : Sample
FAMILY : MOTOR
VERSION : 0.1

VAR_INPUT
Enable : BOOL := FALSE; // 1 = motor enabled
StartCmd : BOOL := FALSE; // start request
StopCmd : BOOL := FALSE; // stop request
Feedback : BOOL := FALSE; // contactor feedback
FbTime : S5TIME := S5T#2S; // max time for feedback
ErrBase : INT := 1000; // base error number
END_VAR

VAR_OUTPUT
MotorOn : BOOL; // contactor command
ErrorNo : INT; // active error number
END_VAR

VAR
Running : BOOL := FALSE;
Status : WORD := W#16#0;
Counter : DINT := L#0;
END_VAR

VAR_TEMP
tErr : BOOL;
tDbNo : INT;
END_VAR

BEGIN

NETWORK
TITLE = Start / stop latch

U(
O #StartCmd
O #Running
)
U #Enable
UN #StopCmd
UN #tErr
= #Running
= #MotorOn

NETWORK
TITLE = Feedback monitoring

U #MotorOn
UN #Feedback
L #FbTime
SE T 10
U T 10
= #tErr
SPBN ok

L #ErrBase
L 1
+I
T #ErrorNo
SPA end

ok: L 0
T #ErrorNo

end: NOP 0

NETWORK
TITLE = Start counter and status word (indirect addressing)

U #MotorOn
FP M 10.0
SPBN nc
L #Counter
L L#1
+D
T #Counter
nc: L #Status
UW W#16#00FF
T #Status

L P##Status
LAR1
L DIW [AR1,P#0.0]
L 0
==I
BEB

AUF DB 20
L DBW 0
T MW 12
CALL "LogEvent" (
Text := 'Motor $'started$'',
Code := DW#16#1234);

END_FUNCTION_BLOCK
71 changes: 71 additions & 0 deletions UDLs/Siemens-AWL-STL_byLudborg.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Siemens AWL (STL) for STEP 7 classic (S7-300/400) and TIA Portal, German mnemonics (U, O, SPBN, AUF...)
For .awl source files exported from STEP 7 / TIA Portal. Light theme.
Folds blocks, VAR...END_VAR sections, STRUCTs and every NETWORK.
Case sensitive: instructions must be upper case, as exported by STEP 7.
-->
<NotepadPlus>
<UserLang name="Siemens AWL" ext="awl" udlVersion="2.1">
<Settings>
<Global caseIgnored="no" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="yes" Keywords6="no" Keywords7="yes" Keywords8="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments">00// 01 02 03 04</Keywords>
<Keywords name="Numbers, prefix1"></Keywords>
<Keywords name="Numbers, prefix2"></Keywords>
<Keywords name="Numbers, extras1"></Keywords>
<Keywords name="Numbers, extras2"></Keywords>
<Keywords name="Numbers, suffix1"></Keywords>
<Keywords name="Numbers, suffix2"></Keywords>
<Keywords name="Numbers, range"></Keywords>
<Keywords name="Operators1">( ) [ ] , ; : :=</Keywords>
<Keywords name="Operators2">= ==I &lt;&gt;I &gt;I &lt;I &gt;=I &lt;=I ==D &lt;&gt;D &gt;D &lt;D &gt;=D &lt;=D ==R &lt;&gt;R &gt;R &lt;R &gt;=R &lt;=R +I -I *I /I +D -D *D /D +R -R *R /R +AR1 +AR2 ==0 &lt;&gt;0 &gt;0 &lt;0 &gt;=0 &lt;=0 + -</Keywords>
<Keywords name="Folders in code1, open"></Keywords>
<Keywords name="Folders in code1, middle"></Keywords>
<Keywords name="Folders in code1, close"></Keywords>
<Keywords name="Folders in code2, open">FUNCTION_BLOCK FUNCTION ORGANIZATION_BLOCK DATA_BLOCK TYPE STRUCT VAR_INPUT VAR_OUTPUT VAR_IN_OUT VAR VAR_TEMP VAR_STAT</Keywords>
<Keywords name="Folders in code2, middle">BEGIN NETWORK</Keywords>
<Keywords name="Folders in code2, close">END_FUNCTION_BLOCK END_FUNCTION END_ORGANIZATION_BLOCK END_DATA_BLOCK END_TYPE END_STRUCT END_VAR</Keywords>
<Keywords name="Folders in comment, open"></Keywords>
<Keywords name="Folders in comment, middle"></Keywords>
<Keywords name="Folders in comment, close"></Keywords>
<Keywords name="Keywords1">VERSION AUTHOR FAMILY NAME KNOW_HOW_PROTECT CODE_VERSION1 UNLINKED READ_ONLY NON_RETAIN RETAIN CONST END_CONST ARRAY OF AT</Keywords>
<Keywords name="Keywords2">U UN O ON X XN S R SET CLR NOT SAVE FN FP L T LC LAR1 LAR2 TAR1 TAR2 TAR CAR TAK PUSH POP ENT LEAVE INC DEC BLD NOP UW OW XOW UD OD XOD SSI SSD SLW SRW SLD SRD RLD RRD RLDA RRDA MOD ABS SQR SQRT EXP LN SIN COS TAN ASIN ACOS ATAN NEGI NEGD NEGR INVI INVD BTI ITB BTD DTB ITD DTR RND TRUNC CAW CAD TAW TAD TDB SI SV SE SS SA FR ZV ZR MCR MCRA MCRD</Keywords>
<Keywords name="Keywords3">SPA SPL SPB SPBN SPBB SPBNB SPBI SPBIN SPO SPS SPZ SPN SPP SPM SPPZ SPMZ SPU LOOP CALL UC CC BE BEA BEB AUF</Keywords>
<Keywords name="Keywords4">BOOL Bool BYTE Byte WORD Word DWORD DWord LWORD LWord CHAR Char WCHAR WChar STRING String WSTRING WString INT Int DINT DInt SINT SInt USINT USInt UINT UInt UDINT UDInt LINT LInt ULINT ULInt REAL Real LREAL LReal TIME Time LTIME LTime S5TIME S5Time DATE Date TIME_OF_DAY Time_Of_Day TOD LTOD DATE_AND_TIME Date_And_Time DT LDT DTL POINTER Pointer ANY Any VOID Void VARIANT Variant BLOCK_DB Block_DB BLOCK_FB Block_FB BLOCK_FC Block_FC BLOCK_SDB Block_SDB COUNTER Counter TIMER Timer Struct Array</Keywords>
<Keywords name="Keywords5">#</Keywords>
<Keywords name="Keywords6">E A M EB EW ED AB AW AD MB MW MD PEB PEW PED PAB PAW PAD DBX DBB DBW DBD DIX DIB DIW DID DB DI DBLG DBNO DILG DINO LB LW LD Z FB FC SFB SFC OB UDT SDB AR1 AR2 STW BIE OV OS UO</Keywords>
<Keywords name="Keywords7">TRUE FALSE B#16# W#16# DW#16# B#( 16# 8# 2# L# P# C# T# S5T# S5TIME# TIME# LT# LTIME# D# DATE# TOD# TIME_OF_DAY# DT# DATE_AND_TIME#</Keywords>
<Keywords name="Keywords8"></Keywords>
<Keywords name="Delimiters">00&apos; 01$ 02&apos; 03&quot; 04 05&quot; 06TITLE 07 08((EOL)) 09{ 10 11} 12 13 14 15 16 17 18 19 20 21 22 23</Keywords>
</KeywordLists>
<Styles>
<WordsStyle name="DEFAULT" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="COMMENTS" fgColor="008000" bgColor="FFFFFF" colorStyle="1" fontStyle="2" nesting="0" />
<WordsStyle name="LINE COMMENTS" fgColor="008000" bgColor="FFFFFF" colorStyle="1" fontStyle="2" nesting="0" />
<WordsStyle name="NUMBERS" fgColor="FF8000" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS1" fgColor="8000FF" bgColor="FFFFFF" colorStyle="1" fontStyle="1" nesting="0" />
<WordsStyle name="KEYWORDS2" fgColor="0000FF" bgColor="FFFFFF" colorStyle="1" fontStyle="1" nesting="0" />
<WordsStyle name="KEYWORDS3" fgColor="C00000" bgColor="FFFFFF" colorStyle="1" fontStyle="1" nesting="0" />
<WordsStyle name="KEYWORDS4" fgColor="008080" bgColor="FFFFFF" colorStyle="1" fontStyle="1" nesting="0" />
<WordsStyle name="KEYWORDS5" fgColor="804000" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS6" fgColor="0080C0" bgColor="FFFFFF" colorStyle="1" fontStyle="1" nesting="0" />
<WordsStyle name="KEYWORDS7" fgColor="FF8000" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS8" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="OPERATORS" fgColor="0000FF" bgColor="FFFFFF" colorStyle="1" fontStyle="1" nesting="0" />
<WordsStyle name="FOLDER IN CODE1" fgColor="8000FF" bgColor="FFFFFF" colorStyle="1" fontStyle="1" nesting="0" />
<WordsStyle name="FOLDER IN CODE2" fgColor="8000FF" bgColor="FFFFFF" colorStyle="1" fontStyle="1" nesting="0" />
<WordsStyle name="FOLDER IN COMMENT" fgColor="008000" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS1" fgColor="A31515" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS2" fgColor="2B91AF" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS3" fgColor="8000FF" bgColor="FFFFFF" colorStyle="1" fontStyle="3" nesting="0" />
<WordsStyle name="DELIMITERS4" fgColor="808080" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS5" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS6" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS7" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS8" fgColor="000000" bgColor="FFFFFF" colorStyle="1" fontStyle="0" nesting="0" />
</Styles>
</UserLang>
</NotepadPlus>
10 changes: 10 additions & 0 deletions udl-list.json
Original file line number Diff line number Diff line change
Expand Up @@ -3329,6 +3329,16 @@
"autoCompletion": "Siebel",
"autoCompletionAuthor": "generate_ac.py"
},
{
"id-name": "Siemens-AWL-STL_byLudborg",
"display-name": "Siemens AWL",
"version": "1.0.0",
"repository": "",
"description": "Siemens AWL / STL (STEP 7 and TIA Portal statement list, German mnemonics), light theme",
"author": "ludborg",
"homepage": "https://github.com/ludborg",
"sample": "Siemens-AWL-STL_byLudborg.awl"
},
{
"id-name": "Siemens-SCL_byTizianoSartini",
"display-name": "Siemens SCL (definition and autocompletion)",
Expand Down