PLCcheck

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 read
S5AWLLLoadLadenaccumulatorACCU1ACCU2

Diesen Artikel auf Deutsch lesen

S5 AWL Command: L (Load)

The L instruction loads a value into accumulator 1 (ACCU1). The previous content of ACCU1 is automatically shifted to ACCU2. This is the foundation of all arithmetic and comparison operations in AWL.

Syntax

L  <operand>

Valid operands: EB/EW/ED (Input byte/word/dword), AB/AW/AD (Output), MB/MW/MD (Marker), DBB/DBW/DBD (Data block), PEW (Peripheral input), T (Timer current value), Z (Counter current value), Constants (KF, KH, KM, KC, KT, KZ, KY)

S7 Equivalent

S5 AWLS7 STLS7 SCL
L MW 10L MW 10 (identical)temp := MW10; (implicit)
L KF +100L 100temp := 100;

Accumulator Behavior

L  MW 10       // ACCU1 = MW10, ACCU2 = (previous ACCU1)
L  MW 20       // ACCU1 = MW20, ACCU2 = MW10
+F             // ACCU1 = ACCU1 + ACCU2 = MW20 + MW10
T  MW 30       // MW30 = result

Key concept: Every L pushes the current ACCU1 to ACCU2. This is why you load two values before an arithmetic operation — the first value ends up in ACCU2, the second in ACCU1.

Code Example — Add Two Values

L  MW 10       // Load first operand into ACCU1
L  MW 20       // First operand moves to ACCU2, second into ACCU1
+F             // ACCU1 = ACCU2 + ACCU1 = MW10 + MW20
T  MW 30       // Store result

Loading Constants

Constant FormatMeaningExample
KF +100Fixed-point integerL KF +100 → loads 100
KH 00FFHexadecimalL KH 00FF → loads 255
KM 11110000 00001111Bit pattern16-bit mask
KC HELLOCharacter (ASCII)2 characters
KT 030.2Timer value3 seconds (base 2 = 100ms)
KZ 050Counter valueBCD counter preset 50
KY 10,20Two bytesHigh byte = 10, low byte = 20

Part of the S5 AWL Command Reference. Maintained by PLCcheck.ai.


Analyze Your S5 Code Automatically

PLCcheck Pro reads your complete S5 AWL program and explains every instruction — including this one — in plain language. Upload your code and get instant documentation, S7 equivalents, and migration guidance.

Upload S5 code for free analysis → | S5→S7 Migration Guide →

Related Articles

Analyze your PLC code with AI

PLCcheck Pro explains, documents, optimizes, and migrates PLC code — automatically.

Try PLCcheck Pro →
← Back to Blog

Not affiliated with Siemens AG. S5, S7, STEP 5, STEP 7, and TIA Portal are trademarks of Siemens AG.