NiLAB
ST to IL Converter
Structured Text to Instruction List - NiLAB uPLC v3.0
Steps 0/128 (0)
Structured Text Input Tab=2 spaces  |  Ctrl+Enter=Convert  |  Click L## in messages to jump to line
Ready - press Convert or start typing
Instruction List destination in orange

  
ST Syntax Reference
VAR Block (typed)
VAR
  name : BOOL;
  name : INT := 0;
  name : TON;
  name : R_TRIG;
END_VAR
BOOL -> R8681/R8682 (max 32)
INT -> R8683..R8688 (max 6)
TON -> R8028/R8029 (max 2)
Constants R8675-R8680: read-only!
Function Blocks
T1(IN:=bit, PT:=100);
C1(CU:=bit, PV:=5);
E1(CLK:=bit); R_TRIG
F1(CLK:=bit); F_TRIG
Use E1.Q in IF conditions
VAR_ALIAS
VAR_ALIAS
  Name := R####.N; (bit)
  Name := R####; (register)
END_VAR_ALIAS
Place before any program statements.
IF / ELSE / END_IF
IF cond THEN
  statements;
ELSE (optional)
  statements;
END_IF;
Operators: AND OR NOT
OK: A AND B AND C
OK: A OR B OR C
NO: A AND B OR C (mixed)
Bit Statements
SET(R####.N);
RESET(R####.N);
R####.N := 1; (SET)
R####.N := 0; (RESET)
Bit index must be 0..15
Register Math
Rc := Ra + Rb;
Rc := Ra - Rb;
Rc := Ra * Rb;
Rc := Ra / Rb;
Rb := Ra; (MOV)
CMP(Ra, Rb);
Destination shown in orange in IL.
Top-level: always executes.
Inside IF: conditional.
Constants (read-only)
R8675 = 0
R8676 = 1
R8678 = 10
R8679 = 100
R8680 = 1000
Cannot be write destination!
Literals 0,1,10,100,1000 auto-map.
Flags R8671
.0 Timer1 expired
.1 Timer2 expired
.2 LT (Pa < Pb after CMP)
.3 EQ (Pa = Pb)
.4 GT (Pa > Pb)
Key Registers
R4620 Digital inputs
R4621 Digital outputs
R4622 User output
R4625 Position low
R4096 Drive control
R8028 Timer1
R8029 Timer2
R8683..R8685 User registers
Gutter markers
! Error on this line
W Warning on this line
i Hint
Click L## tags to jump to line.
Limits
Max 128 instructions
Stack depth = 1
No FOR / WHILE / nested IF
No arithmetic in conditions
NiLAB uPLC ST-to-IL Converter v3.0 Stack depth 1 | 128 steps | 6ms scan | FW >= 5E41 NiLAB GmbH
Symbol Table auto-assigned from VAR block
No typed variables — use VAR...END_VAR block
Inputs (R4620)
Click to toggle bit
Outputs (R4621)
OUT0
OUT1
OUT2
MOT EN
R4622 Value
0
Flags (R8671)
T1 T2 LT EQ GT
T1: 0  T2: 0
Controls
Speed
Space = Step (when paused)
Status
Cycle: 0
Stack: 0
Registers
DI R4620
DO R4621
OUT R4622
CTL R4096
POS R4625
FLG R8671
T1 R8028
T2 R8029
UA R8683
UB R8684
UC R8685
UD R8686