Siemens PLC programming instruction set
1 bit logic instruction
1.1 -||- Normally open contact (address)
1.2 -|/|- Normally closed contact (address)
1.3 XOR Bit exclusive OR
1.4 -|NOT|- Signal Flow Reverse
1.5 -( ) Output Coil
1.6 -(#)- Intermediate Output
1.7 -(R) Coil Reset
1.8 -(S) Coil Set
1.9 RS Reset Set Flip-Flop
1.10 RS Set Reset Flip-Flop
1.11 -(N)- RLO Falling Edge Detection
1.12 -(P)- PLO Rising Edge Detection
> 1.13 -(SAVE) Store RLO into BR memory
1.14 MEG Address falling edge detection
1.15 POS Address rising edge detection
2 Comparison instruction
2.1 CMP?I Integer Comparison
2.2 CMP?D Double Integer Comparison
2.3 CMP?RReal number comparison
3 Conversion instruction
3.1 BCD_IBCD code converted to integer
3.2 I_BCD Converted integer to BCD code
3.3 I_DINT Converted integer to double integer
3.4 BCD_DIBCD code Convert to Double Integer
3.5 DI_BCD Convert Double Integer to BCD Code
3.6 DI_REAL Convert Double Integer to Floating Point Number
3.7 INV_I Integer’s One’s Complement Code
3.8 INV_DI Double Integer’s One’s Complement Code
3.9 NEG_I Two’s complement of integer
3.10 NEG_DI Two’s complement of double integer
3.11 NEG_R Negate floating point number
3.12 ROUND Round to double integer
3.13 TRUNC Round to double integer
3.14 CEIL round up
3.15 FLOOR round down
4 counter instruction
4.1 S_CUD add and subtract
4.2 S_CU add counter
4.3 S_CD Decrement counter
4.4 -(SC) Set counter to initial value
4.5 -(CU) Add counter coil
4.6 -(CD) Decrement counter coil
5 Data block instruction
5.1 -(OPN) Open data block: DB or DI
6 Logic control instruction
6.1 -(JMP) Unconditional jump
6.2 -(JMP) Condition Jump
6.3 -(JMPN) Jump if not
6.4 LABEL Label
7 Integer arithmetic operation instruction
7.1 ADD_I Integer addition
7.2 SUB_I Integer subtraction
7.3 MUL_I integer multiplication
7.4 DIV_I integer division
7.5 ADD_DI double integer addition
7.6 SUB_DI double integer subtraction
7.7 MUL_DI double integer multiplication
7.8 DIV_DI double integer division
OD _ 7.9 M Double integer returning remainder
8 Floating-point arithmetic operation instruction
8.1 Basic instructions
8.1.1 ADD_R real number addition
8.1.2 SUB_R real numberSubtraction
8.1.3 MUL_R Multiplication of real numbers
8.1.4 DIV_R Division of real numbers
8.1.5 ABS Absolute value operation of floating point numbers
8.2 Extended instructions
8.2.1 SQR Square of floating point numbers
8.2.2 SQRT Floating-point square root
8.2.3 EXP Floating-point exponential operation
8.2.4 LN Floating-point natural logarithm operation
8.2.5 SIN Floating-point sine operation
8.4.6 COS Float Point number cosine operation
8.2.7 TAN Floating point tangent operation
8.2.8 ASIN Floating point arc sine operation
8.2.9 ACOS Floating point arc tangent operation
8.2.10ATAN Floating point arc tangent operation
9 Assignment instruction
9.1 MOVE Assignment
10 Program control instruction
10.1 -(Call) Call FC/SFC from the coil (no parameter)
10.2 CALL_FB Call FB from block
10.3 CALL_FC Call FC from block
10.4 CALL_SFB Call SFB from block
10.5 CALL_SFC Call SFC from block
10.6 -(MCR<) Master control relay is on
10.7 -(MCR>) Master Control RelayElectrical Disconnect
10.8 -(MCRA) Master Control Relay Start
10.9 -(MCRD) Master Control Relay Stop
10.10 -(RET) Return
11 Shift and Cycle Instructions
11.1 Shift Instruction
11.1.1 SHR_I Integer Right Shift
11.1.2 SHR_DI Double Integer Right Shift
11.1.3 SHL_W Word Left Shift
11.1.4 SHR_W Word Right Shift
11.1.5 SHL_DW double word left shift
11.1.6 SHR_DW double word right shift
11.2 cycle instruction
11.2.1 ROL_DW double word left rotate
11.2.2 ROR_DW double word right rotate
12 Status Bit Instruction
12.1 OV -||- Overflow Exception Bit
12.2 OS -||- Store Overflow Exception Bit
12.3 UO -||- Unordered Exception Bits
12.4 BR -||- Exception Bits Binary Result
12.5 ==0-||- Result Bits Equal to “0”
12.6 0-||- Result Bits Not Equal to “0”
12.7 >0-||- The result bit is greater than “0”
12.8 <0-||- The result bit is less than "0"
12.9 >=0-||- The result bit is greater than or equal to “0”
12.10 <=0-||- The result bit is less than or equal to "0"
13 Timer instruction
13.1 S_PULSE pulse S5 timer
13.2 S_PEXT extended pulse S5 timer
13.3 S_ODT on-delay S5 timer
13.4 S_ODTS hold-type on-delay S5 timer
13.5 S_OFFDT Power-off delay S5 timer
13.6 -(SP) Pulse timer coil
13.7 -(SE) Extended pulse timer coil
13.8 -(SD) On-delay timer coil
13.9 -(SS) On-delay timer coil for retentive type
13.10 -(SF) Off-delay timer coil
14 word logic instruction
14.1 WAND_W Word sum word phase “and”
14.2 WOR_W word and word phase” or “
14.3 WAND_DW double word and double word phase” and “
14.4 WOR_DW Double word and double word phase “or”
14.5 WXOR_W Word and word phase “exclusive OR”
14.6 WXOR_DW Double word and double word phase “exclusive OR”