Siemens S7 Note: For Compare and Math Shift/Rotate
I Integer (16 bit) SSI Shift Sign Integer
Statement List (STL) Double Integer Shift Sign Double by category D SSD (32 bit) Integer Bit logic Real – Floating SLW Shift Left Word R Point (32 bit) SRW A And Shift Right Word AN And Not Compare if true RLO = 1 Shift Left Double SLD O Or ==I ==D ACC2 is equal to Word ==R ACC1 Shift Right Double ON Or Not SRD <>I <>D ACC2 is not equal Word X Exclusive Or <>R Rotate Left Double to ACC1 RLD XN Exclusive Or Not >I >D ACC2 is greater Word >R then to ACC1 Rotate Right FN Edge Negative RRD Double Word FP Edge Positive >=I >=D ACC2 is greater Rotate ACC1 Left >=R then equal to ACC1 RLDA ( ) Nesting via CC 1 <I <D ACC2 is less then Rotate ACC1 Right = Assign <R to ACC1 RRDA via CC 1 R Reset <=I <=D ACC2 is less then S Set <=R equal to ACC1 Accumulator NOT Negate RLO Toggle ACC1 with Math TAK SET Set RLO (=1) ACC2 Add Integer POP Pop accumulators CLR Clear RLO (=O) + Constant (16, 32- Bit) PUSH Push accumulators Save RLO in BR SAVE +I +D ENT Enter ACC Stack Register Add ACC1 and ACC2 +R LEAVE Leave ACC Stack Convert -I -D Subtract ACC1 from DEC Decrement ACC BTI BCD to Integer -R ACC2 INC Increment ACC ITB Integer to BCD *I *D Multiply ACC1 and *R ACC2 Add ACC1 to +AR1 BTD BCD to Integer Address Register 1 /I /D Divide ACC2 by Integer to Double /R ACC1 Add ACC1 to ITD +AR2 Integer Division Remainder Address Register 2 Double Integer to MOD Program Display DTB Double Integer BLD BCD Instruction (Null) Double Integer to Floating Point Math NOP 0 Null Instruction DTR Floating-Point ABS Absolute Value Ones Complement Formats INVI ACOS Arc Cosine Integer B# Byte (8 bit) Ones Complement ASIN Arc Sine INVD ATAN Arc Tangent W# Word (16 bit) Double Integer Twos Complement COS Cosine of Angles L# Long (32 bit) NEGI S5 Time Integer EXP Exponential Value S5Time# Twos Complement (2H46M30S0MS) NEGD LN Natural Logarithm IEC Time Double Integer T# Negate Floating- SIN Sine of Angles (24D20H31M23S648MS) NEGR IEC Date Point Number SQR Square D# Change Byte SQRT Square Root (2007-10-28) CAW Sequence in ACC1 Time of Day TAN Tangent of Angles TOD# Word (23:59:59.999) Change Byte Word logic C# BCD CAD Sequence in ACC1 P# Pointer Address AW AND Word Double AD AND Double Word 2# Binary RND Round OW OR Word 16# Hexadecimal TRUNC Truncate Round to Lower OD OR Double Word Local stack RND- #Symbol Double Integer XOW Exclusive Or Word variable Round to Upper Exclusive Or // Comment RND+ XOD Double Integer Double Word Program Control Load Timers/Counters (0 to 255) CALL Call FC,FB,SFC,SFB L Load Enable Timer/Counter FR Example parameter passing Load Status Word (Free) CALL FC1 or FB1, DB1 L STW Load Current into ACC1 PARAM1 := I0.0 Load Address Timer/Counter Value L PARAM2 := “Example”.Test LAR1 Register 1 from into ACC1 as Integer CC Conditional Call ACC1 (i.e. L T 32) UC Unconditional Call Load Address Load Current Register 1 with Timer/Counter Value BE Block End LAR1 <D> LC Double Integer into ACC1 as BCD Block End (i.e. LC T 32) BEC (32-Bit Pointer) Conditional R Reset Timer/Counter Load Address Block End BEU Register 1 Set Counter Preset Unconditional LAR1 AR2 S from Address Value (i.e. S C 15) Save RLO in MCR MCR( Register 2 SD On-Delay Timer Stack, Begin MCR Load Address Retentive On-Delay )MCR End MCR LAR2 SS Register 2 from Timer MCRA Activate MCR ACC1 SP Pulse Timer MCRD Deactivate MCR Load Address SF Off-Delay Timer Register 2 with Jumps LAR2 <D> SE Extended Pulse Timer Double Integer JU Jump Unconditional (32-Bit Pointer) CD Counter Down JL Jump to Labels Exchange Address CU Counter Up JC Jump if RLO = 1 Register 1 CAR OBs with Address JCN Jump if RLO = 0 Register 2 1 Main Program Scan Jump if RLO = 1 with 10-17 Time of Day JCB BR Transfer Jump if RLO = 0 with T Transfer 20-23 Time Delay JNB 30-38 Cyclic (Periodic) BR Transfer ACC1 T STW JBI Jump if BR = 1 into Status Word 40-47 Hardware JNBI Jump if BR = 0 Transfer Address 80 Time Error TAR1 Register 1 to JO Jump if OV = 1 81 Power Supply Error ACC1 JOS Jump if OS = 1 Transfer Address 82 Diagnostic Interrupt JZ Jump if Zero Register 1 to Insert/Remove Module TAR1 <D> 83 JN Jump if Not Zero Destination (32- Interrupt JP Jump if Plus Bit Pointer) 84 CPU Hardware Fault JM Transfer Address 85 Program Cycle Error Jump if Minus Register 1 Rack Failure – JPZ Jump if Plus or Zero TAR1 AR2 to Address 86 Missing Profibus Jump if Minus or Register 2 JMZ device Zero Transfer Address 87 Communication Error JUO Jump if Unordered TAR2 Register 2 to LOOP Loop ACC1 100 Warm restart Transfer Address 101 Hot restart Data Blocks Register 2 to 102 Cold restart TAR2 <D> OPN Open a Data Block Destination (32- 121 Programming Error Exchange Shared DB Bit Pointer) CDB 122 I/O Access Error and Instance DB Load Length of L DBLG Shared DB in ACC1 Load Number of L DBNO Shared DB in ACC1 Load Length of L DILG Instance DB in ACC1 Load Number of L DINO Instance DB in ACC1