forked from Serhioromano/vscode-st
-
Notifications
You must be signed in to change notification settings - Fork 0
/
st_demo.st
68 lines (56 loc) · 1.46 KB
/
st_demo.st
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
(* Program TODO: comment *)
{ Attribute: pragma; }
PROGRAM PLC_PRG
VAR
sDoubleQuoted: STRING := "test\tmething";
sSingleQuoted: STRING := 'Another WHILE \n\r string';
xStart AT %IX0.0.1: BOOL := TRUE;
rTest: REAL := 12.3e4; (* dsfsfsdfs sd fsdf *)
iTest: INT := 1234;
bTest: BYTE := 2#0010_0110;
tTest: TIME := T#20s;
dtTest: DT := DT#2018-12-12-00:00:00;
pTest: POINTER TO BOOL;
aTest: ARRAY[1..2] OF strName;
fbMyTon1: MY_TON;
fbTon2: TON;
END_VAR
TON(IN := TRUE, PT := T#2s, Q => xOut);
actionTest(DS, T#2s);
// TODO: Single line comment
pTest := ADR(xStart, dfdf, dfkld);
IF (pTest^ OR (bTest > 16#2F)) THEN
rTemp := ABS(100.5);
END_IF;
WHILE tTime > & TON.Q AND 123 > INT#25 DO
10 + INT_TO_BOOL(100 / (12));
MyFunction();
UPPER();
SEL();
END_WHILE;
CASE iTest OF
CTU.OUT();
TON.Q.T_EST();
something.test;
SOmething.Tst();
END_CASE;
END_PROGRAM
/* TODO: This is r
multiple lines comment */
TYPE
strName: STRUCT
another: INT;
dkfjdkjf: MY_TEST;
xother AT %IX0.0.1 : BOOL;
some: ARRAY[0..9] OF BOOL := [TRUE, FALSE, TRUE, TRUE];
END_STRUCT
END_TYPE
FUNCTION sdfdf : BOOL
END_FUNCTION
FUNCTION_BLOCK RTE
VAR
sdfsdf: BOOL; (* dfdf *)
END_VAR
END_FUNCTION_BLOCK
PROGRAM MyProgram
END_PROGRAM