×
Siemens Industry Online Support
Siemens AG
Entry type: FAQ Entry ID: 14529143, Entry date: 02/21/2003
(1)
Rate

Considerations for the conversion of S5 programs to S7

  • Entry
  • Associated product(s)

QUESTION:
What do I have to consider when converting S5 programs to S7 programs?

ANSWER:  
STEP 7 includes a S5/S7 converter which can be used to convert S5 to S7 programs as complete as possible. This converter has certain particularities:

  • Converting special commands for CPUs of the SIMATIC S5 135U and SIMATIC S5 155U series is not possible.
    This applies to access to the area system data of the CPU (e.g.: L BS 0..255 / T BS 0..255).
  • The modules in the library "S5-S7 Converting Blocks" (visible in the SIMATIC Manager with File > Open > Libraries in "Standard Library") are intended only for conversions of existing S5 programs to S7 programs. They cannot be used in newly created S7 programs.

    This STEP 7 library offers the following standard solutions:

Functions of floating point arithmetic:

Name Explanation Number
GP_ADD Add floating point numbers FC 63
GP_DIV Divide floating point numbers FC 66
GP_FPGP Change fixed point number to floating point number FC 61
GP_GPFP Change floating point number to fixed point number FC 62
GP_MUL Multiply floating point number FC 65
GP_SUB Subtract floating point numbers FC 64
GP_VGL Compare floating point numbers FC 67
RAD_GP Extract root of floating point numbers FC 68


Signal functions:

Name Explanation Number
MLD_ED Message of first value with double flashing light, bitwise, A FC 76
MLD_EDK Message of first value with double flashing light, bitwise, A+M  FC 80
MLD_EDW Message of first value with double flashing light, wordwise, A FC 72
MLD_EDWK Message of first value with double flashing light, wordwise, A+M FC 78
MLD_EZ  Message of first value with single flashing light, bitwise, A FC 75
MLD_EZK Message of first value with single flashing light, bitwise, A+M FC 79
MLD_EZW Message of first value with single flashing light, wordwise, A FC 71
MLD_EZWK Message of first value with single flashing light, wordwise, A+M FC 77
MLD_SAM Collected message, bitwise FC 74
MLD_SAMW Collected message, wordwise (sound alert) FC 73
MLD_TG Clock generator FC 69
MLD_TGZ Clock generator (timing element) FC 70


Integrated functions:

Name Explanation Number
COD_B4 Change BCD number to 16 bit dual number FC 81
COD_16 Change 16 bit dual number to BCD number FC 82
MUL_16 Multiply 16 bit dual numbers FC 83
DIV_16 Divide 16 bit dual numbers FC 84


Calculating functions:

Name Explanation Number
ADD_32 Add 32 bit dual numbers FC 85
DIV_32 Divide 32 bit dual numbers FC 88
MUL_32  Multiply 32 bit dual numbers FC 87
RAD_16 Extract roots of 16 bit dual numbers FC 89
SUB_32 Subtract 32 bit dual numbers FC 86


Registry functions:

Name Explanation Number
REG_FIFO Buffer memory (FIFO) FC 92
REG_LIFO Stack register (LIFO) FC 93
REG_SCHB Bi-directional shift register, bitwise FC 90
REG_SCHW  Bi-directional shift register, wordwise FC 91


Copying data areas:

Name Explanation Number
DB_COPY1 Copy data block, direct assignment of parameters FC 94
DB_COPY2  Copy data block, indirect assignment of parameterization  FC 95


Special functions:

Name Explanation Number
LADEN Load scratchpad memory FC 97
RETTEN Save scratchpad memory FC 96
COD_B8 Change BCD number to 32 bit dual number FC 98
COD_32 Change 32 bit dual number to BCD number FC 99


Values Read and Write:

Name Explanation Number
AE_460_1 Read analog value FC 100
AE_460_2 Read analog value FC 101
AE_463_1  Read analog value FC 102
AE_463_2 Read analog value FC 103
AE_464_1 Read analog value FC 104
AE_464_2 Read analog value FC 105
AE_466_1 Read analog value FC 106
AE_466_2 Read analog value FC 107
PER_ET1 Read and Write for extended periphery (direct assignment of parameters) FC 110
PER_ET2 Read and Write for extended periphery (indirect assignment of parameters) FC 111
RLG_AA1 Output analog value FC 108
RLG_AA2 Output analog value  FC 109

Note:
When using the standard functions FC100-FC111, the peripherial addresses are to be observed (see also online help for these blocks). The refreshment of the process image depends on the S7 CPU. If you assign a partly peripherial address (between 1 and 8) to the address, these addresses are not taken into account in the cyclic refreshment of the process image.

Mathematical functions:

Name Explanation Number
A2_H_A1 AKKU 2 to the power of AKKU 1 FC 125
ARCCOS Arc cosine (x) FC 117
ARCCOT Arc cotangens (x) FC 119
ARCSIN Arc sine (x) FC 116
ARCTAN Arc tangent (x)  FC 118
B_LOG_X General logarithm Iog (x) to basis b  FC 122
COSINUS Cosine (x)  FC 113
COTANG Cotangent (x) FC 115
E_H_N e to the power of n FC 123
LG_X Decade logarithm Iog (x) FC 121
LN_X Natural logarithm ln (x)  FC 120
SINUS Sine (x) FC 112
TANGENS Tangent (x) FC 114
ZEHN_H_N 10 to the power of n FC 124

Further information on the conversion of S5 programs to S7 programs can be found in the manual "Simatic from S5 to S7", that is at your disposal under the entry-ID 1118413.

Security information
In order to protect technical infrastructures, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art IT security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about cyber security, please visit
https://www.siemens.com/cybersecurity#Ouraspiration.