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.
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.
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.
S5 AWL Command: NOP (No Operation)
S5 AWL instruction NOP 0 / NOP 1: No operation. Used as jump target placeholder and for program alignment.
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.
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.
S5 AWL Command: SPBN (Jump if NOT)
S5 AWL instruction SPBN: Jump to label if VKE is FALSE. The inverse of SPB.
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.
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.
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.
S5 AWL Command: SPA (Unconditional Jump)
S5 AWL instruction SPA: Unconditional jump to a label. Always executed regardless of VKE state.
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.
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.
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.
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.
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.
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.
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.
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).
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).
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.
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.
S5 AWL Command: T (Transfer)
S5 AWL instruction T (Transfer): Stores the content of ACCU1 to an operand. The counterpart to L (Load).
S5 AWL Command: L (Load)
S5 AWL instruction L (Load): Loads a value into accumulator 1 (ACCU1). Previous ACCU1 content shifts to ACCU2.
S5 AWL Command: = (Assign)
S5 AWL instruction = (Assign): Writes the current VKE to a boolean operand. Non-latching — output follows VKE directly.
S5 AWL Command: R (Reset)
S5 AWL instruction R (Reset): Resets a bit to FALSE when VKE is TRUE. Counterpart to S (Set).
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.
S5 AWL Command: O (OR)
S5 AWL instruction O (OR): Syntax, S7 equivalent, code examples. OR bit logic operation for the VKE.
S5 AWL Command: UN (AND NOT)
S5 AWL instruction UN (AND NOT): Syntax, S7 equivalent, code examples. Negated AND operation for the VKE.
S5 AWL Command: ON (OR NOT)
S5 AWL instruction ON (OR NOT): Negated OR operation. Syntax, S7 equivalent, and code examples.
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.