PLCcheck

S5 AWL Command Reference

S5 AWL Commands: Comparison Operations (!=F, ><F, >F, <F)

S5 AWL comparison instructions: !=F (equal), ><F (not equal), >F (greater), <F (less). Compare ACCU2 with ACCU1, result in VKE.

4 min readS5AWLcomparison

S5 AWL Commands: SET / CLR (VKE Control)

S5 AWL instructions SET (force VKE to TRUE) and CLR (force VKE to FALSE). Unconditionally set the VKE state.

2 min readS5AWLSET

S5 AWL Command: DO FW / DO DW (Direct Peripheral Access)

S5 AWL instruction DO (Direct Operation): System operation for direct peripheral and memory access on S5-135U/155U CPUs. Not available on S5-115U. Bypasses the process image.

3 min readS5AWLDO

S5 AWL Command: NOP (No Operation)

S5 AWL instruction NOP 0 / NOP 1: No operation. Used as jump target placeholder and for program alignment.

2 min readS5AWLNOP

S5 AWL Commands: TAK, ENT (Accumulator Operations)

S5 AWL accumulator instructions: TAK (swap ACCU1/ACCU2) and ENT (push ACCU2 to ACCU3). Advanced operations for multi-value calculations.

3 min readS5AWLTAK

S5 AWL Commands: +F, -F, +G (Integer Arithmetic)

S5 AWL arithmetic instructions: +F (INT add), -F (INT subtract), +G (DINT add). Operates on ACCU1 and ACCU2. S7 equivalents: +I, -I, +D.

4 min readS5AWL+F

S5 AWL Command: SPBN (Jump if NOT)

S5 AWL instruction SPBN: Jump to label if VKE is FALSE. The inverse of SPB.

2 min readS5AWLSPBN

S5 AWL Command: A DB (Open Data Block)

S5 AWL instruction A DB: Opens a data block for subsequent DW/DL/DR/D access. The DB stays open until another A DB is called.

4 min readS5AWLA DB

S5 AWL Commands: SPA FB / SPA PB (Block Calls)

S5 AWL instructions SPA FB and SPA PB for calling function blocks and program blocks. S7 equivalents: CALL FB / CALL FC.

4 min readS5AWLSPA

S5 AWL Commands: BE, BEA, BEB (Block End)

S5 AWL instructions BE (Block End), BEA (Block End Absolute), BEB (Block End Conditional). Three ways to end a block in S5 AWL.

3 min readS5AWLBE

S5 AWL Command: SPA (Unconditional Jump)

S5 AWL instruction SPA: Unconditional jump to a label. Always executed regardless of VKE state.

3 min readS5AWLSPA

S5 AWL Command: SPB (Conditional Jump)

S5 AWL instruction SPB: Jump to label if VKE is TRUE. The primary conditional branching instruction — equivalent to IF in high-level languages.

4 min readS5AWLSPB

S5 AWL Command: SI (Pulse Timer)

S5 AWL instruction SI (Zeit als Impuls): Starts a pulse timer. Output is TRUE for the set duration, but goes FALSE immediately if the input goes FALSE before the timer expires.

3 min readS5AWLSI

S5 AWL Constant Formats: KF, KH, KM, KC, KT, KZ, KY

Complete reference for all S5 AWL constant formats: KF (fixed-point), KH (hex), KM (bit mask), KC (character), KT (timer), KZ (counter), KY (two-byte). With S7 equivalents.

5 min readS5AWLconstants

S5 AWL Command: SS (Retentive On-Delay)

S5 AWL instruction SS (Retentive On-Delay): Timer continues counting even when input goes FALSE. Output goes TRUE when full duration has elapsed. Must be explicitly reset with R.

3 min readS5AWLSS

S5 AWL Command: SE (Extended Pulse Timer)

S5 AWL instruction SE (Extended Pulse): Timer runs for full duration regardless of input state. Retriggerable — a new TRUE edge restarts the timer.

3 min readS5AWLSE

S5 AWL Command: SD (On-Delay Timer)

S5 AWL instruction SD (On-Delay): Output goes TRUE only after the input has been TRUE for the full timer duration. Resets if input goes FALSE before timer expires.

3 min readS5AWLSD

S5 AWL Command: SA (Off-Delay Timer)

S5 AWL instruction SA (Off-Delay): Output stays TRUE for the set duration after input goes FALSE. Direct equivalent to IEC TOF.

4 min readS5AWLSA

S5 AWL Command: ZV (Count Up)

S5 AWL instruction ZV (Count Up): Increments a counter by 1 on each rising edge of the VKE. Counter range 0–999 (BCD).

3 min readS5AWLZV

S5 AWL Command: ZR (Count Down)

S5 AWL instruction ZR (Count Down): Decrements a counter by 1 on each rising edge. Counter stops at 0 (does not go negative).

3 min readS5AWLZR

S5 AWL Command: FP (Positive Edge)

S5 AWL instruction FP (Positive Edge): Detects a rising edge (FALSE→TRUE transition) of the VKE. Requires a flag bit for edge memory.

3 min readS5AWLFP

S5 AWL Command: FN (Negative Edge)

S5 AWL instruction FN (Negative Edge): Detects a falling edge (TRUE→FALSE transition). Requires an edge memory flag bit.

3 min readS5AWLFN

S5 AWL Command: T (Transfer)

S5 AWL instruction T (Transfer): Stores the content of ACCU1 to an operand. The counterpart to L (Load).

2 min readS5AWLT

S5 AWL Command: L (Load)

S5 AWL instruction L (Load): Loads a value into accumulator 1 (ACCU1). Previous ACCU1 content shifts to ACCU2.

4 min readS5AWLL

S5 AWL Command: = (Assign)

S5 AWL instruction = (Assign): Writes the current VKE to a boolean operand. Non-latching — output follows VKE directly.

3 min readS5AWLassign

S5 AWL Command: R (Reset)

S5 AWL instruction R (Reset): Resets a bit to FALSE when VKE is TRUE. Counterpart to S (Set).

2 min readS5AWLR

S5 AWL Command: S (Set)

S5 AWL instruction S (Set): Sets a bit to TRUE when VKE is TRUE. The bit stays TRUE until explicitly reset with R.

2 min readS5AWLS

S5 AWL Command: O (OR)

S5 AWL instruction O (OR): Syntax, S7 equivalent, code examples. OR bit logic operation for the VKE.

3 min readS5AWLO

S5 AWL Command: UN (AND NOT)

S5 AWL instruction UN (AND NOT): Syntax, S7 equivalent, code examples. Negated AND operation for the VKE.

2 min readS5AWLUN

S5 AWL Command: ON (OR NOT)

S5 AWL instruction ON (OR NOT): Negated OR operation. Syntax, S7 equivalent, and code examples.

2 min readS5AWLON

S5 AWL Command: U (AND)

S5 AWL instruction U (UND/AND): Syntax, description, S7 equivalent, code examples, and common errors. Complete reference for the AND bit logic operation.

3 min readS5AWLU