Difference between revisions of "S7-SoftPLC:Instruction set"

From IBHsoftec Wiki English
Jump to: navigation, search
(Program display and null operation instructions)
 
(10 intermediate revisions by one other user not shown)
Line 243: Line 243:
 
|}
 
|}
  
==== Shift and rotating instructions ====
+
== Shift and rotating instructions ==
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 249: Line 249:
 
! Operation  !! Operand !! Description
 
! Operation  !! Operand !! Description
 
|-
 
|-
|style="width: 5em"| SLW ||style="width: 5em"|  ||style="width: 22em"| Shift ACCU1-L left (word shift)
+
|style="width: 5em"| SLW ||style="width: 5em"|  ||style="width: 23em"| Shift ACCU1-L left (word shift)
 
|-
 
|-
 
| SLD ||  || Shift ACCU1 left (double word shift)
 
| SLD ||  || Shift ACCU1 left (double word shift)
Line 295: Line 295:
 
|}
 
|}
  
==== Counter instructions ====
+
== Counter instructions ==
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 312: Line 312:
 
|}
 
|}
  
==== Word instructions ====
+
== Word instructions ==
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 335: Line 335:
 
|}
 
|}
  
==== Arithmetic instructions ====
+
== Arithmetic instructions ==
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 341: Line 341:
 
! Operation  !! Operand !! Description
 
! Operation  !! Operand !! Description
 
|-
 
|-
|style="width: 5em"| ==I ||style="width: 5em"|  ||style="width: 22em"| Integervergleich GLEICH
+
|style="width: 5em"| ==I ||style="width: 5em"|  ||style="width: 22em"| Integer values equal
 
|-
 
|-
| <>I ||  || Integervergleich UNGLEICH
+
| <>I ||  || Integer values unequal
 
|-
 
|-
| >I ||  || Integervergleich GRÖSSER
+
| >I ||  || Integer values greater
 
|-
 
|-
| >=I ||  || Integervergleich GRÖSSER GLEICH
+
| >=I ||  || Integer values greather or equal
 
|-
 
|-
| <I ||  || Integervergleich KLEINER
+
| <I ||  || Integer values less
 
|-
 
|-
| <=I ||  || Integervergleich KLEINER GLEICH
+
| <=I ||  || Integer values less or equal
 
|-
 
|-
| ==D ||  || Doppel-Integervergleich GLEICH
+
| ==D ||  || Double integer values equal
 
|-
 
|-
| <>D ||  || Doppel-Integervergleich UNGLEICH
+
| <>D ||  || Double integer values unequal
 
|-
 
|-
| >D ||  || Doppel-Integervergleich GRÖSSER
+
| >D ||  || Double integer values greater
 
|-
 
|-
| >=D ||  || Doppel-Integervergleich GRÖSSER GLEICH
+
| >=D ||  || Double integer values greater or equal
 
|-
 
|-
| <D ||  || Doppel-Integervergleich KLEINER
+
| <D ||  || Double integer values less
 
|-
 
|-
| <=D ||  || Doppel-Integervergleich KLEINER GLEICH
+
| <=D ||  || Double integer values less or equal
 
|-
 
|-
| ==R ||  || REAL-Zahl Vergleich GLEICH
+
| ==R ||  || Real values equal
 
|-
 
|-
| <>R ||  || REAL-Zahl Vergleich UNGLEICH
+
| <>R ||  || Real values unequal
 
|-
 
|-
| >R ||  || REAL-Zahl Vergleich GRÖSSER
+
| >R ||  || Real values greater
 
|-
 
|-
| >=R ||  || REAL-Zahl Vergleich GRÖSSER GLEICH
+
| >=R ||  || Real values greater or equal
 
|-
 
|-
| <R ||  || REAL-Zahl Vergleich KLEINER
+
| <R ||  || Real values less
 
|-
 
|-
| <=R ||  || REAL-Zahl Vergleich KLEINER GLEICH
+
| <=R ||  || Real values less or equal
 
|-
 
|-
| SIN ||  || Sinus
+
| SIN ||  || Sine of a real value
 
|-
 
|-
| COS ||  || Cosinus
+
| COS ||  || Cosine of a real value
 
|-
 
|-
| TAN ||  || Tangens
+
| TAN ||  || Tangent of a real value
 
|-
 
|-
| ASIN ||  || Arcussinus
+
| ASIN ||  || Arcsine of a real value
 
|-
 
|-
| ACOS ||  || Arcuscosinus
+
| ACOS ||  || Arccosine of a real value
 
|-
 
|-
| ATAN ||  || Arcustangens
+
| ATAN ||  || Arctangent of a real value
 
|-
 
|-
| SQR ||  || Quadrieren
+
| SQR ||  || Square a real value
 
|-
 
|-
| SQRT ||  || Wurzel (Radizieren)
+
| SQRT ||  || Square root a real value
 
|-
 
|-
| EXP ||  || Exponent zur Basis e
+
| EXP ||  || e to the power of a real value
 
|-
 
|-
| LN ||  || Natürlicher Logarithmus
+
| LN ||  || Natural logarithm of a real value
 
|-
 
|-
| +I ||  || Integer Addition
+
| +I ||  || Integer addition
 
|-
 
|-
| -I ||  || Integer Subtraktion
+
| -I ||  || Integer subtraction
 
|-
 
|-
| *I ||  || Integer Multiplikation
+
| *I ||  || Integer multiplication
 
|-
 
|-
| /I ||  || Integer Division
+
| /I ||  || Integer division
 
|-
 
|-
| +D ||  || Doppel-Integer Addition
+
| +D ||  || Double-integer addition
 
|-
 
|-
| -D ||  || Doppel-Integer Subtraktion
+
| -D ||  || Double-integer subtraction
 
|-
 
|-
| *D ||  || Doppel-Integer Multiplikation
+
| *D ||  || Double-integer multiplication
 
|-
 
|-
| /D ||  || Doppel-Integer Division
+
| /D ||  || Double-integer division
 
|-
 
|-
| +R ||  || Realzahl Addition
+
| +R ||  || Real addition
 
|-
 
|-
| -R ||  || Realzahl Subtraktion
+
| -R ||  || Real subtraction
 
|-
 
|-
| *R ||  || Realzahl Multiplikation
+
| *R ||  || Real multiplication
 
|-
 
|-
| /R ||  || Realzahl Division
+
| /R ||  || Real division
 
|-
 
|-
| MOD ||  || Doppel-Integer Division (Rest)
+
| MOD ||  || Double integer division (modulo)
 
|-
 
|-
| + || konst || Addieren einer Konstante
+
| + || const || Add a constant
 
|-
 
|-
| +P# || konst || Addieren eines Zeigers
+
| +P# || const || Add a pointer
 
|-
 
|-
| DEC ||  || Dekrementieren
+
| DEC ||  || dekrement ACCU1-LL (one byte)
 
|-
 
|-
| INC ||  || Inkrementieren
+
| INC ||  || inkrement ACCU1-LL (one byte)
 
|}
 
|}
  
Line 438: Line 438:
 
! Operation  !! Operand !! Description
 
! Operation  !! Operand !! Description
 
|-
 
|-
|style="width: 5em"| ITD ||style="width: 5em"|  ||style="width: 22em"| Wandlung INT nach DINT
+
|style="width: 5em"| ITD ||style="width: 5em"|  ||style="width: 22em"| Convert integer to double integer
 
|-
 
|-
| ITB ||  || Wandlung INT nach BCD
+
| ITB ||  || Convert integer to BCD
 
|-
 
|-
| DTB ||  || Wandlung DINT nach BCD
+
| DTB ||  || Convert double integer to BCD
 
|-
 
|-
| DTR ||  || Wandlung DINT nach REAL
+
| DTR ||  || Convert double integer to real
 
|-
 
|-
| BTI ||  || Wandlung BCD nach INT
+
| BTI ||  || Convert BCD to integer
 
|-
 
|-
| BTD ||  || Wandlung BCD nach DINT
+
| BTD ||  || Convert BCD to double integer
 
|-
 
|-
| RND ||  || Rundung zur nächsten ganzen Zahl
+
| RND ||  || Convert real to double integer (round)
 
|-
 
|-
| RND+ ||  || Rundung zur nächstgrößeren Zahl
+
| RND+ ||  || Convert real to double integer (round up)
 
|-
 
|-
| RND- ||  || Rundung zur nächstkleineren Zahl
+
| RND- ||  || Convert real to double integer (round down)
 
|-
 
|-
| TRUNC ||  || ohne Rundung
+
| TRUNC ||  || Convert real to double integer (truncate)
 
|-
 
|-
| INVI ||  || INT-Einerkomplement
+
| INVI ||  || Invert ACCU1-L (integer)
 
|-
 
|-
| INVD ||  || DINT-Einerkomplement
+
| INVD ||  || Invert ACCU1 (double integer)
 
|-
 
|-
| NEGI ||  || INT-Negation
+
| NEGI ||  || Negate ACCU1-L (integer)
 
|-
 
|-
| NEGD ||  || DINT-Negation
+
| NEGD ||  || Negate ACCU1 (double integer)
 
|-
 
|-
| NEGR ||  || REAL-Negation
+
| NEGR ||  || Negate ACCU1 (real)
 
|-
 
|-
| ABS ||  || REAL-Betragsbildung
+
| ABS ||  || Absolute value (real)
 
|}
 
|}
  
Line 477: Line 477:
 
! Operation  !! Operand !! Description
 
! Operation  !! Operand !! Description
 
|-
 
|-
|style="width: 5em"| SPA ||style="width: 5em"| Ziel ||style="width: 22em"| Sprung absolut (unbedingt)
+
|style="width: 5em"| JU ||style="width: 5em"| goal ||style="width: 26em"| Jump unconditional
 
|-
 
|-
| SPB || Ziel || Sprung wenn VKE = 1
+
| JC || goal || Jump if RLO = 1
 
|-
 
|-
| SPBB || Ziel || Sprung wenn VKE = 1 (VKE speichern)
+
| JCB || goal || Jump if RLO = 1 (save RLO)
 
|-
 
|-
| SPBN || Ziel || Sprung wenn VKE = 0
+
| JCN || goal || Jump if RLO = 0
 
|-
 
|-
| SPBNB || Ziel || Sprung wenn VKE = 0 (VKE speichern)
+
| JNB || goal || Jump if RLO = 0 (save RLO)
 
|-
 
|-
| SPBI || Ziel || Sprung wenn BIE = 1
+
| JBI || goal || Jump if BR = 1
 
|-
 
|-
| SPBIN || Ziel || Sprung wenn BIE = 0
+
| JNBI || goal || Jump if BR = 0
 
|-
 
|-
| SPZ || Ziel || Sprung bei Vergleichsergebnis = 0
+
| JZ || goal || Jump if compare result = 0
 
|-
 
|-
| SPN || Ziel || Sprung bei Vergleichsergebnis ≠ 0
+
| JN || goal || Jump if compare result != 0
 
|-
 
|-
| SPP || Ziel || Sprung bei Vergleichsergebnis > 0
+
| JP || goal || Jump if compare result > 0
 
|-
 
|-
| SPPZ || Ziel || Sprung bei Vergleichsergebnis >= 0
+
| JPZ || goal || Jump if compare result >= 0
 
|-
 
|-
| SPM || Ziel || Sprung bei Vergleichsergebnis < 0
+
| JM || goal || Jump if compare result < 0
 
|-
 
|-
| SPMZ || Ziel || Sprung bei Vergleichsergebnis <= 0
+
| JMZ || goal || Jump if compare result <= 0
 
|-
 
|-
| SPU || Ziel || Sprung bei Vergleichsergebnis ungültig
+
| JUO || goal || Jump if compare result "Unordered Math Instruction"
 
|-
 
|-
| SPO || Ziel || Sprung bei Overflow
+
| JO || goal || Jump on overflow
 
|-
 
|-
| SPS || Ziel || Sprung bei speicherndem Overflow
+
| JOS || goal || Jump on saving overflow
 
|-
 
|-
| SPL || Ziel || Sprungverteiler
+
| JL || goal || Jump distributor
 
|-
 
|-
| LOOP || Ziel || Schleife
+
| LOOP || goal || Loop programming (decrement ACCU1-L and jump if != 0
 
|}
 
|}
  
==== Block call instructions ====
+
== Block call instructions ==
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 520: Line 520:
 
! Operation  !! Operand !! Description
 
! Operation  !! Operand !! Description
 
|-
 
|-
|style="width: 5em"| CALL FB ||style="width: 5em"|  ||style="width: 22em"| Sprung zum Funktionsbaustein
+
|style="width: 5em"| CALL FB ||style="width: 5em"|  ||style="width: 26em"| Unconditional call of an FB with parameter transfer
 
|-
 
|-
| CALL FC ||  || Sprung zur Funktion
+
| CALL FC ||  || Unconditional call of an FC with parameter transfer
 
|-
 
|-
| CALL SFB ||  || Sprung zum System-Funktionsbaustein
+
| CALL SFB ||  || Unconditional call of an SFB with parameter transfer
 
|-
 
|-
| CALL SFC ||  || Sprung zur System-Funktion
+
| CALL SFC ||  || Unconditional call of an SFC with parameter transfer
 
|-
 
|-
| UC FB ||  || Funktionsbaustein absolut aufrufen
+
| UC FB ||  || Unconditional call of an FB without parameter transfer
 
|-
 
|-
| CC FB ||  || Funktionsbaustein bedingt aufrufen
+
| CC FB ||  || Conditional call of an FB without parameter transfer
 
|-
 
|-
| UC FC ||  || Funktion absolut aufrufen
+
| UC FC ||  || Unconditional call of an FC without parameter transfer
 
|-
 
|-
| CC FC ||  || Funktion bedingt aufrufen
+
| CC FC ||  || Conditional call of an FC without parameter transfer
 
|-
 
|-
| BEA ||  || Bausteinende absolut
+
| BEU ||  || End block unconditionally
 
|-
 
|-
| BEB ||  || Bausteinende bedingt
+
| BEC ||  || End block conditionally (RLO = 1)
 
|-
 
|-
| BE ||  || Bausteinende
+
| BE ||  || End block
 
|-
 
|-
| AUF || DB || Datenbaustein öffnen
+
| OPN || ||
 
|-
 
|-
|  || DI || Instanz-Datenbaustein öffnen
+
|  || DB || Open data block
 
|-
 
|-
| TDB ||  || Datenbausteinregister tauschen
+
|  || DI || Open instance data block
 +
|-
 +
| TDB ||  || Exchange data block registers
 
|}
 
|}
  
==== Indirect adressing instructions ====
+
== Indirect adressing instructions ==
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 555: Line 557:
 
! Operation  !! Operand !! Description
 
! Operation  !! Operand !! Description
 
|-
 
|-
|style="width: 5em"| LAR1 ||style="width: 5em"|  ||style="width: 22em"| AR1 laden
+
|style="width: 5em"| LAR1/LAR2 ||style="width: 5em"|  ||style="width: 22em"| Load AR1/AR2
 
|-
 
|-
| LAR2 || || AR2 laden
+
| || MD || with memory double word
 
|-
 
|-
|  || MD || mit Merkerdoppelwort
+
|  || LD || with local data double word
 
|-
 
|-
|  || LD || mit Lokaldatendoppelwort
+
|  || DBD || with datablock double word
 
|-
 
|-
|  || DBD || mit Datenbausteindoppelwort
+
|  || DID || with instance data block double word
 
|-
 
|-
| || DID || mit Instanz-Datenbausteindoppelwort
+
| LAR1 || - || Load AR1 with ACCU1
 
|-
 
|-
| LAR1 || || AR1 laden mit Inhalt aus Akku1
+
| LAR2 || - || Laod AR2 with ACCU1
 
|-
 
|-
| LAR2 || || AR2 laden mit Inhalt aus Akku1
+
| LAR1 || AR2 || Load AR1 with AR2
 
|-
 
|-
| LAR1 || AR2 || AR1 laden mit Inhalt aus A2
+
| LAR1 || P# || Load AR1 with pointer
 
|-
 
|-
| LAR1 || P# || AR1 laden mit Zeiger
+
| LAR2 || P# || Load AR2 with pointer
 
|-
 
|-
| LAR2 || P# || AR2 laden mit Zeiger
+
| TAR1/TAR2 || || Transfer in AR1/AR2
 
|-
 
|-
| TAR1 || || Schreibe AR1
+
| || MD || in memory double word
 
|-
 
|-
| TAR2 || || Schreibe AR2
+
| || LD || in local data double word
 
|-
 
|-
|  || MD || in Merkerdoppelwort
+
|  || DBD || in datablock double word
 
|-
 
|-
|  || LD || in Lokaldatendoppelwort
+
|  || DID || in instance data block double word
 
|-
 
|-
| || DBD || in Datenbausteindoppelwort
+
| TAR1 || - || Transfer AR1 in ACCU1
 
|-
 
|-
| || DID || in Instanz-Datenbausteindoppelwort
+
| TAR2 || - || Transfer AR2 in ACCU1
 
|-
 
|-
| TAR1 || || Schreibe AR1 in Akku1
+
| TAR1 || AR2 || Transfer AR1 in AR2
 
|-
 
|-
| TAR2 ||  || Schreibe AR2 in Akku1
+
| TAR ||  || Swap AR1 with AR2
 
|-
 
|-
| TAR1 || AR2 || AR1 nach AR2 transferieren
+
| +AR1 || || Add ACCU1 to AR1
 
|-
 
|-
| TAR ||  || AR1 mit AR2 tauschen
+
| +AR2 ||  || Add ACCU1 to AR2
 
|-
 
|-
| +AR1 || || Addiere Akku1 zu AR1
+
| +AR1 || P# || Add pointer to AR1
 
|-
 
|-
| +AR2 ||  || Addiere Akku1 zu AR2
+
| +AR2 || P# || Add pointer to AR2
|-
+
| +AR1 || P# || Addiere Pointer zu AR1
+
|-
+
| +AR2 || P# || Addiere Pointer zu AR2
+
 
|}
 
|}
  
==== Program display and null operation instructions ====
+
== Program display and null operation instructions ==
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 612: Line 610:
 
! Operation  !! Operand !! Description
 
! Operation  !! Operand !! Description
 
|-
 
|-
|style="width: 5em"| NOP ||style="width: 5em"| 0 ||style="width: 22em"| Nulloperation
+
|style="width: 5em"| NOP ||style="width: 5em"| 0 ||style="width: 22em"| Null operation instruction
 
|-
 
|-
| NOP || 1 || Nulloperation
+
| NOP || 1 || Null operation instruction
 
|-
 
|-
| BLD || konst || Bildaufbau
+
| BLD || const || Program display instruction (null operation)
 
|}
 
|}
  
'''Layout of ''S7-SoftPLC'' memory'''<br />
 
The memory of ''S7-SoftPLC 315'' and ''S7-SoftPLC 416'' is compatible to the memory of SIMATIC<sup>®</sup>-control S7-315 or S7-416.<br />
 
Please note, that the low-order byte has to be interchanged with the high-order byte when accessing this memory with Windows programs.
 
  
'''Layout of SoftPLC system data'''<br />
+
'''Layout of ''S7-SoftPLC'' memory'''
The layout of the system data in the system data is compatible to the system data of SIMATIC<sup>®</sup>-control S7-315 or S7-416.
+
  
'''Integrated organisation blocks'''<br />
+
The memory of ''S7-SoftPLC 315'' and ''S7-SoftPLC 416'' is compatible to the memory of SIMATIC<sup>®</sup>-control S7-315 or S7-416.
The organisation blocks, listed in the chart below, are executed, if they are programmed:
+
 
 +
Please note, that the low-order byte has to be interchanged with the high-order byte when accessing this memory with Windows programs.
 +
 
 +
 
 +
'''Layout of SoftPLC system data'''
 +
 
 +
The layout of the system data in the system data is compatible to the system data of SIMATIC<sup>®</sup>-control S7-315 or S7-416.
 +
 
 +
 
 +
'''Integrated organisation blocks'''
 +
 
 +
The organisation blocks, listed in the chart below, are executed, if they are programmed:
  
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! OB-Nr !! Kurzbeschreibung
+
! OB no !! Short Description
 
|-
 
|-
|style="width:14em"| OB 1 ||style="width:14em"| Hauptprogramm
+
|style="width:14em"| OB 1 ||style="width:14em"| Main programm
 
|-
 
|-
| OB 10 – OB 17 || Uhrzeitalarm
+
| OB 10 – OB 17 || Time alarm
 
|-
 
|-
| OB 20 – OB 23 || Verzögerungsalarm
+
| OB 20 – OB 23 || Delay alarm
 
|-
 
|-
| OB 30 – OB 38 || Zeitbausteine (zyklischer Aufruf)
+
| OB 30 – OB 38 || Time blocks (cyclic call)
 
|-
 
|-
| OB 80 – OB 87 || Fehlerbausteine
+
| OB 80 – OB 87 || Error blocks
 
|-
 
|-
| OB 90 || Hintergrundbearbeitung
+
| OB 90 || Background execution
 
|-
 
|-
| OB 100/OB 101 || Neustart bzw. Wiederanlauf
+
| OB 100/OB 101 || Warm or hot restart
 
|-
 
|-
| OB 121/OB 122 || Programmierfehler
+
| OB 121/OB 122 || Programming faults
 
|}
 
|}
  
'''Integrated system functions'''<br />
+
 
All system functions (SFC) relevant for a Software PLC are integrated in ''S7-SoftPLC''.<br />
+
'''Integrated system functions'''
The chart below shows the available SFCs(in numeric listing)
+
 
 +
All system functions (SFC) relevant for a Software PLC are integrated in ''S7-SoftPLC''.
 +
 
 +
The chart below shows the available SFCs(in numeric listing)
  
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! SFC-Nr !! SFC-Name !! Kurzbeschreibung
+
! SFC no !! SF name !! Short Description
 
|-
 
|-
|style="width:7em"| SFC 0 ||style="width:8em"| SET_CLK || Setzen der Systemzeit
+
|style="width:7em"| SFC 0 ||style="width:8em"| SET_CLK || Set system clock
 
|-
 
|-
| SFC 1 || READ_CLK || Lesen der Systemzeit
+
| SFC 1 || READ_CLK || Read system clock
 
|-
 
|-
| SFC 5  (3) || GADR_LGC || Logische Basisadresse einer Baugruppe ermitteln
+
| SFC 5  (3) || GADR_LGC || Detect the logic basis address of a component
 
|-
 
|-
| SFC 6 || RD_SINFO || Startinformation des aktuellen OBs auslesen
+
| SFC 6 || RD_SINFO || Read out start information of actual OBs
 
|-
 
|-
| SFC 13 (1) || DPNRM_DG || Slave-Diagnose eines DP-Slaves
+
| SFC 13 (1) || DPNRM_DG || Slave-Diagnosis of a DP-slave
 
|-
 
|-
| SFC 14 (2) || DPRD_DAT || Konsistente Daten eines DP-Normslaves lesen
+
| SFC 14 (2) || DPRD_DAT || Read consistent data of a DP-norm slave
 
|-
 
|-
| SFC 15 (2) || DPWR_DAT || Daten konsistent auf DP-Normslave schreiben
+
| SFC 15 (2) || DPWR_DAT || Write data consistent on DP-norm slave
 
|-
 
|-
| SFC 20 || BLKMOV || SPS-Variable in Zielbereich kopieren
+
| SFC 20 || BLKMOV || Copy PLC-variable in target-area
 
|-
 
|-
| SFC 21 || FILL || SPS-Variable in Zielbereich vorbesetzen
+
| SFC 21 || FILL || Preoccupy PLC-variable in target-area
 
|-
 
|-
| SFC 22 || CREAT_DB || Anlegen von Datenbausteinen
+
| SFC 22 || CREAT_DB || Create data block
 
|-
 
|-
| SFC 23 || DEL_DB || Datenbaustein löschen
+
| SFC 23 || DEL_DB || Delete data block
 
|-
 
|-
| SFC 24 || TEST_DB || Attribute eines Datenbausteins testen
+
| SFC 24 || TEST_DB || Test attributes of a data block
 
|-
 
|-
| SFC 25 || COMPRESS || Ladespeicher komprimieren
+
| SFC 25 || COMPRESS || Compress load memory
 
|-
 
|-
| SFC 28 || SET_TINT || Stellen eines Uhrzeitalarms
+
| SFC 28 || SET_TINT || Set time alarm
 
|-
 
|-
| SFC 29 || CAN_TINT || Uhrzeitalarm anhalten (nicht ausführen)
+
| SFC 29 || CAN_TINT || Stop time alarm (do not execute)
 
|-
 
|-
| SFC 30 || ACT_TINT || Uhrzeitalarm freigeben
+
| SFC 30 || ACT_TINT || Enable time alarm
 
|-
 
|-
| SFC 31 || QRY_TINT || Status des Uhrzeitalarms
+
| SFC 31 || QRY_TINT || Status of time alarm
 
|-
 
|-
| SFC 32 || SRT_DINT || Starte Verzögerungsalarm
+
| SFC 32 || SRT_DINT || Start delay alarm
 
|-
 
|-
| SFC 33 || CAN_DINT || Unterbreche Verzögerungsalarm
+
| SFC 33 || CAN_DINT || Stop delay alarm
 
|-
 
|-
| SFC 34 || QRY_DINT || Statusabfrage des Verzögerungsalarms
+
| SFC 34 || QRY_DINT || Status query of delay alarm
 
|-
 
|-
| SFC 36 || MSK_FLT || Maskieren eines synchronen Fehlerereignisses
+
| SFC 36 || MSK_FLT || Mask a synchron error occurrence
 
|-
 
|-
| SFC 37 || DMSK_FLT || Demaskieren eines synchronen Fehlerereignisses
+
| SFC 37 || DMSK_FLT || Demask a synchron error occurrence
 
|-
 
|-
| SFC 38 || READ_ERR || Auslesen des Ereignisstatusregister
+
| SFC 38 || READ_ERR || Read out the occurrence status register
 
|-
 
|-
| SFC 39 || DIS_IRT || Sperren der Asynchron- und Alarmfehlerbearbeitung
+
| SFC 39 || DIS_IRT || Locking the asynchron and alarm error processing
 
|-
 
|-
| SFC 40 || EN_IRT || Freigeben der Asynchron- und Alarmfehlerbearbeitung
+
| SFC 40 || EN_IRT || Enable the asynchron and alarm error processing
 
|-
 
|-
| SFC 41 || DIS_AIRT || Verzögerung höherpriorer Asynchron- und Alarmfehlerbearbeitung
+
| SFC 41 || DIS_AIRT || Delay high-priority asynchron and alarm error processing
 
|-
 
|-
| SFC 42 || EN_AIRT || Freigabe höherpriorer Asynchron- und Alarmfehlerbearbeitung
+
| SFC 42 || EN_AIRT || Enable high-priority asynchron and alarm error processing
 
|-
 
|-
| SFC 43 || RE_TRIGR || Nachtriggern des Watchdogs
+
| SFC 43 || RE_TRIGR || Retrigger the Watchdog
 
|-
 
|-
| SFC 46 || STP || CPU Betriebszustand STOP
+
| SFC 46 || STP || CPU operating state STOP
 
|-
 
|-
| SFC 49 (3) || LGC_GADR || Ermitteln des Steckplatzes einer logischen Adresse
+
| SFC 49 (3) || LGC_GADR || Detect the solt of a logic address
 
|-
 
|-
| SFC 50 (3) || RD_LAGADR || Ermitteln aller logischer Adressen einer Baugruppe
+
| SFC 50 (3) || RD_LAGADR || Detect all logic addresses of a component
 
|-
 
|-
| SFC 51 || RDSYST || Systemzustandsliste (SZL) auslesen
+
| SFC 51 || RDSYST || Read out system status list (SSL)
 
|-
 
|-
 
| SFC 64 || TIME_TCK || Timer Tick
 
| SFC 64 || TIME_TCK || Timer Tick
 
|-
 
|-
| SFC 81 || UBLKMOV || Block Move der nicht unterbrochen werden kann
+
| SFC 81 || UBLKMOV || Block Move, that can not be stopped
 
|}
 
|}
  
  
1)The SFC 13 is available only, when the driver Cifcfg.dll is loaded. Furthermore it can only return valid results, if the PROFIBUS<sup>®</sup> configuration has been created via the ''S7 for Windows''<sup>®</sup> hardware configuration or the STEP<sup>®</sup>7 hardware configuration. This is only possible when using the driver CIFCFG.DLL.<br />
+
(1)The SFC 13 is available only, when the driver Cifcfg.dll is loaded. Furthermore it can only return valid results, if the PROFIBUS<sup>®</sup> configuration has been created via the ''S7 for Windows''<sup>®</sup> hardware configuration or the STEP<sup>®</sup>7 hardware configuration. This is only possible when using the driver CIFCFG.DLL.
2)The SFC 14 and SFC 15 are available only, if they are loaded via the driver CIF30D0.DLL or the driver CIFCFG.DLL.<br />
+
3)The SFCs can only return valid results, if the PROFIBUS<sup>®</sup>7 configuration has been created via the ''S7 for Windows''<sup>®</sup>7 hardware configuration or the STEP<sup>®</sup>7 hardware configuration. This is only possible when using the driver CIFCFG.DLL.
+
  
'''Integrated system blocks'''<br />
+
(2)The SFC 14 and SFC 15 are available only, if they are loaded via the driver CIF30D0.DLL or the driver CIFCFG.DLL.
The system blocks (SFB) relevant for a software PLC are integrated in ''S7-SoftPLC''. <br />
+
 
The following system function blocks are supported:
+
(3)The SFCs can only return valid results, if the PROFIBUS<sup>®</sup>7 configuration has been created via the ''S7 for Windows''<sup>®</sup>7 hardware configuration or the STEP<sup>®</sup>7 hardware configuration. This is only possible when using the driver CIFCFG.DLL.
 +
 
 +
 
 +
'''Integrated system blocks'''
 +
 
 +
The system blocks (SFB) relevant for a software PLC are integrated in ''S7-SoftPLC''.
 +
 
 +
The following system function blocks are supported:
  
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! SFB-Nr !! SFB-Name !! Kurzbeschreibung
+
! SFB no !! SFB name !! Short Description
 
|-
 
|-
|style="width:7em"| SFB 0 ||style="width:7em"| CTU || Vorwärtszähler (Counter Up)
+
|style="width:7em"| SFB 0 ||style="width:7em"| CTU || Count up
 
|-
 
|-
| SFB 1 || CTD || Rückwärtszähler (Counter Down)
+
| SFB 1 || CTD || Count down
 
|-
 
|-
| SFB 2 || CTUD || Vorwärts- und Rückwärtszähler
+
| SFB 2 || CTUD || Count up and down
 
|-
 
|-
| SFB 3 || TP || Zeitimpuls
+
| SFB 3 || TP || Generate pulse
 
|-
 
|-
| SFB 4 || TON || Einschaltverzögerung
+
| SFB 4 || TON || Generate ON-delay
 
|-
 
|-
| SFB 5 || TOF || Ausschaltverzögerung
+
| SFB 5 || TOF || Generate OFF-delay
 
|-
 
|-
| SFB 32 || DRUM || Schaltwerk zur Steuerung von Schrittketten
+
| SFB 32 || DRUM || Implement sequencer
 
|-
 
|-
| SFB 52 (4) || RDREC_DP || Datensatz lesen
+
| SFB 52 (4) || RDREC_DP || Read data record
 
|-
 
|-
| SFB 53 (4) || WRREC_DP || Datensatz schreiben
+
| SFB 53 (4) || WRREC_DP || Write data record
 
|}
 
|}
  
 
+
(4)The SFB 52 and SFB 53 are only available if the driver CIFCFG.DLL is loaded and the entry DPV1=1 is set.
4)The SFB 52 and SFB 53 are only available if the driver CIFCFG.DLL is loaded and the entry DPV1=1 is set.
+

Latest revision as of 13:01, 23 January 2013

The programming language of the IBHsoftec S7-SoftPLC 315and S7-SoftPLC 416 controls is STEP®7 and can be made with the programming tools S7 for Windows® or STEP®7 from Siemens. The complete instruction set of the STEP®7 language is supported.

The S7-SoftPLC 315 has the complete instruction set of the SIMATIC® S7-315 CPU.

The S7-SoftPLC 416 has the complete instruction set of the SIMATIC® S7-416 CPU.

Bit logic instructions

Instruction Operand Description
A AND with a scan to "1"“
AN AND with a scan to "0"
O OR with scan to "1"
ON OR with scan to "0"
X Exclusive-OR with a scan to "1"
XN Exclusive-OR with a scan to "0"
I of an input
Q of an output
M of a memory
L of a local data bit
T of a timer
C of a counter
DBX of a data bit
DIX of an instant data bit
==0 result equal zero
<>0 result unequal zero
>0 result greater than zero
>=0 result greater or equal zero
<0 result less than zero
<=0 result less or equal zero
UO invalid result
OV overflow
OS overflow (saving)
BR binary result

Other boolean logic instructions

Operation Operand Description
A( AND left parenthesis
AN( AND NOT left parenthesis
O( OR left parenthesis
ON( OR NOT left parenthesis
X( Exclusive OR left parenthesis
XN( Exclusive OR NOT left parenthesis
) Right parenthesis
O OR-ing AND operations
NOT Negate RLO
SET Set RLO to "1"
CLR Set RLO to "0"
SAVE Save RLO to the BR bit
Operation Operand Description
= Assign value of RLO
S Set
R Reset
FP Positive edge detection
FN Negative edge detection
I of an input bit
Q of an output bit
M of a memory bit
L of a local data bit
DBX of a data bit
DIX of a instance data bit

Master Control Relay

Operation Operand Description
MCRA Activate MCR
MCRD Deactivate MCR
MCR( Open MCR zone
)MCR Close MCR zone

Load / Transfer instructions

Operation Operand Description
L Load operand
T Transfer operand
IB Input byte
IW Input word
ID Input double word
QB Output byte
QW Output word
QD Ouput double word
MB Memory byte
MW Memory word
MD Memory double word
LB Local data byte
LW Local data word
LD Local data double word
DBB Data block byte
DBW Data block word
DBD Data block double word
DIB Instance data block byte
DIW Instance data block word
DID Instance data block double word
STW Status word
L const Load constant value
L #Pointer Load pointer
L T Timer
LC T Timer (BCD coded)
L Z Counter
LC Z Counter (BCD coded)
L DBNO Data block number
L DBLG Data block length
L DINO Instance data block number
L DILG Instance data block length

Peripheral access instructions

Operation Operand Description
L PIB Load peripheral input byte
L PIW Load peripheral input word
L PID Load peripheral input double word
T PQB Transfer peripheral output byte
T PQW Transfer peripheral output word
T PQD Transfer peripheral output double word

Accumulator instructions

Operation Operand Description
PUSH Push accumulators upwards
POP Push accumulators downwards
ENT Push accumulators (without A1) A2->A3, A3->A4
LEAVE Push accumulators (without A1) A4->A3, A3->A2
TAK Change ACCU1 with ACCU2
CAW Change ACCU1 bytes 0 and 1
CAD Change ACCU1 bytes 0 and 3, 1 and 2

Shift and rotating instructions

Operation Operand Description
SLW Shift ACCU1-L left (word shift)
SLD Shift ACCU1 left (double word shift)
SRW Shift ACCU1-L right (word shift)
SRD Shift ACCU1 right (double word shift)
SSI Shift ACCU1-L right (word shift with sign)
SSD Shift ACCU1 right (double word shift with sign)
RLD Rotate ACCU1 left (double word)
RLDA Rotate ACCU1 left through CC1
RRDA Rotate ACCU1 right through CC1
RRD Rotate ACCU1 right (double word)
const Number of places to shift/rotate
- Number of places to shift/rotate located in ACCU2

Timer instructions

Operation Operand Description
SP T Start as impulse
SE T Start as extendet impulse
SD T Start as ON-delay
SS T Start as saving ON-delay
SF T Start as OFF-delay
R T Reset timer
FR T Enable timer

Counter instructions

Operation Operand Description
CU C Count up (increment)
CD C Count down (decrement)
S C Set counter
R C Reset counter
FR C Enable counter

Word instructions

Operation Operand Description
AW AND ACCU1-L (AND word)
AD AND ACCU1 (AND double word)
OW OR ACCU1-L (OR word)
OD OR ACCU1 (OR double word)
XOW Exclusive-OR ACCU (XOR word)
XOD Exclusive-OR ACCU (XOR double word)
const with a word or double word constant
- with ACCU2

Arithmetic instructions

Operation Operand Description
==I Integer values equal
<>I Integer values unequal
>I Integer values greater
>=I Integer values greather or equal
<I Integer values less
<=I Integer values less or equal
==D Double integer values equal
<>D Double integer values unequal
>D Double integer values greater
>=D Double integer values greater or equal
<D Double integer values less
<=D Double integer values less or equal
==R Real values equal
<>R Real values unequal
>R Real values greater
>=R Real values greater or equal
<R Real values less
<=R Real values less or equal
SIN Sine of a real value
COS Cosine of a real value
TAN Tangent of a real value
ASIN Arcsine of a real value
ACOS Arccosine of a real value
ATAN Arctangent of a real value
SQR Square a real value
SQRT Square root a real value
EXP e to the power of a real value
LN Natural logarithm of a real value
+I Integer addition
-I Integer subtraction
*I Integer multiplication
/I Integer division
+D Double-integer addition
-D Double-integer subtraction
*D Double-integer multiplication
/D Double-integer division
+R Real addition
-R Real subtraction
*R Real multiplication
/R Real division
MOD Double integer division (modulo)
+ const Add a constant
+P# const Add a pointer
DEC dekrement ACCU1-LL (one byte)
INC inkrement ACCU1-LL (one byte)

Data type conversion instructions

Operation Operand Description
ITD Convert integer to double integer
ITB Convert integer to BCD
DTB Convert double integer to BCD
DTR Convert double integer to real
BTI Convert BCD to integer
BTD Convert BCD to double integer
RND Convert real to double integer (round)
RND+ Convert real to double integer (round up)
RND- Convert real to double integer (round down)
TRUNC Convert real to double integer (truncate)
INVI Invert ACCU1-L (integer)
INVD Invert ACCU1 (double integer)
NEGI Negate ACCU1-L (integer)
NEGD Negate ACCU1 (double integer)
NEGR Negate ACCU1 (real)
ABS Absolute value (real)

Jump instructions

Operation Operand Description
JU goal Jump unconditional
JC goal Jump if RLO = 1
JCB goal Jump if RLO = 1 (save RLO)
JCN goal Jump if RLO = 0
JNB goal Jump if RLO = 0 (save RLO)
JBI goal Jump if BR = 1
JNBI goal Jump if BR = 0
JZ goal Jump if compare result = 0
JN goal Jump if compare result != 0
JP goal Jump if compare result > 0
JPZ goal Jump if compare result >= 0
JM goal Jump if compare result < 0
JMZ goal Jump if compare result <= 0
JUO goal Jump if compare result "Unordered Math Instruction"
JO goal Jump on overflow
JOS goal Jump on saving overflow
JL goal Jump distributor
LOOP goal Loop programming (decrement ACCU1-L and jump if != 0

Block call instructions

Operation Operand Description
CALL FB Unconditional call of an FB with parameter transfer
CALL FC Unconditional call of an FC with parameter transfer
CALL SFB Unconditional call of an SFB with parameter transfer
CALL SFC Unconditional call of an SFC with parameter transfer
UC FB Unconditional call of an FB without parameter transfer
CC FB Conditional call of an FB without parameter transfer
UC FC Unconditional call of an FC without parameter transfer
CC FC Conditional call of an FC without parameter transfer
BEU End block unconditionally
BEC End block conditionally (RLO = 1)
BE End block
OPN
DB Open data block
DI Open instance data block
TDB Exchange data block registers

Indirect adressing instructions

Operation Operand Description
LAR1/LAR2 Load AR1/AR2
MD with memory double word
LD with local data double word
DBD with datablock double word
DID with instance data block double word
LAR1 - Load AR1 with ACCU1
LAR2 - Laod AR2 with ACCU1
LAR1 AR2 Load AR1 with AR2
LAR1 P# Load AR1 with pointer
LAR2 P# Load AR2 with pointer
TAR1/TAR2 Transfer in AR1/AR2
MD in memory double word
LD in local data double word
DBD in datablock double word
DID in instance data block double word
TAR1 - Transfer AR1 in ACCU1
TAR2 - Transfer AR2 in ACCU1
TAR1 AR2 Transfer AR1 in AR2
TAR Swap AR1 with AR2
+AR1 Add ACCU1 to AR1
+AR2 Add ACCU1 to AR2
+AR1 P# Add pointer to AR1
+AR2 P# Add pointer to AR2

Program display and null operation instructions

Operation Operand Description
NOP 0 Null operation instruction
NOP 1 Null operation instruction
BLD const Program display instruction (null operation)


Layout of S7-SoftPLC memory

The memory of S7-SoftPLC 315 and S7-SoftPLC 416 is compatible to the memory of SIMATIC®-control S7-315 or S7-416.

Please note, that the low-order byte has to be interchanged with the high-order byte when accessing this memory with Windows programs.


Layout of SoftPLC system data

The layout of the system data in the system data is compatible to the system data of SIMATIC®-control S7-315 or S7-416.


Integrated organisation blocks

The organisation blocks, listed in the chart below, are executed, if they are programmed:

OB no Short Description
OB 1 Main programm
OB 10 – OB 17 Time alarm
OB 20 – OB 23 Delay alarm
OB 30 – OB 38 Time blocks (cyclic call)
OB 80 – OB 87 Error blocks
OB 90 Background execution
OB 100/OB 101 Warm or hot restart
OB 121/OB 122 Programming faults


Integrated system functions

All system functions (SFC) relevant for a Software PLC are integrated in S7-SoftPLC.

The chart below shows the available SFCs(in numeric listing)

SFC no SF name Short Description
SFC 0 SET_CLK Set system clock
SFC 1 READ_CLK Read system clock
SFC 5 (3) GADR_LGC Detect the logic basis address of a component
SFC 6 RD_SINFO Read out start information of actual OBs
SFC 13 (1) DPNRM_DG Slave-Diagnosis of a DP-slave
SFC 14 (2) DPRD_DAT Read consistent data of a DP-norm slave
SFC 15 (2) DPWR_DAT Write data consistent on DP-norm slave
SFC 20 BLKMOV Copy PLC-variable in target-area
SFC 21 FILL Preoccupy PLC-variable in target-area
SFC 22 CREAT_DB Create data block
SFC 23 DEL_DB Delete data block
SFC 24 TEST_DB Test attributes of a data block
SFC 25 COMPRESS Compress load memory
SFC 28 SET_TINT Set time alarm
SFC 29 CAN_TINT Stop time alarm (do not execute)
SFC 30 ACT_TINT Enable time alarm
SFC 31 QRY_TINT Status of time alarm
SFC 32 SRT_DINT Start delay alarm
SFC 33 CAN_DINT Stop delay alarm
SFC 34 QRY_DINT Status query of delay alarm
SFC 36 MSK_FLT Mask a synchron error occurrence
SFC 37 DMSK_FLT Demask a synchron error occurrence
SFC 38 READ_ERR Read out the occurrence status register
SFC 39 DIS_IRT Locking the asynchron and alarm error processing
SFC 40 EN_IRT Enable the asynchron and alarm error processing
SFC 41 DIS_AIRT Delay high-priority asynchron and alarm error processing
SFC 42 EN_AIRT Enable high-priority asynchron and alarm error processing
SFC 43 RE_TRIGR Retrigger the Watchdog
SFC 46 STP CPU operating state STOP
SFC 49 (3) LGC_GADR Detect the solt of a logic address
SFC 50 (3) RD_LAGADR Detect all logic addresses of a component
SFC 51 RDSYST Read out system status list (SSL)
SFC 64 TIME_TCK Timer Tick
SFC 81 UBLKMOV Block Move, that can not be stopped


(1)The SFC 13 is available only, when the driver Cifcfg.dll is loaded. Furthermore it can only return valid results, if the PROFIBUS® configuration has been created via the S7 for Windows® hardware configuration or the STEP®7 hardware configuration. This is only possible when using the driver CIFCFG.DLL.

(2)The SFC 14 and SFC 15 are available only, if they are loaded via the driver CIF30D0.DLL or the driver CIFCFG.DLL.

(3)The SFCs can only return valid results, if the PROFIBUS®7 configuration has been created via the S7 for Windows®7 hardware configuration or the STEP®7 hardware configuration. This is only possible when using the driver CIFCFG.DLL.


Integrated system blocks

The system blocks (SFB) relevant for a software PLC are integrated in S7-SoftPLC.

The following system function blocks are supported:

SFB no SFB name Short Description
SFB 0 CTU Count up
SFB 1 CTD Count down
SFB 2 CTUD Count up and down
SFB 3 TP Generate pulse
SFB 4 TON Generate ON-delay
SFB 5 TOF Generate OFF-delay
SFB 32 DRUM Implement sequencer
SFB 52 (4) RDREC_DP Read data record
SFB 53 (4) WRREC_DP Write data record

(4)The SFB 52 and SFB 53 are only available if the driver CIFCFG.DLL is loaded and the entry DPV1=1 is set.