show the entry list
STEP 7 (TIA Portal) -- Creating S7 programs -- Creating program sequences
How can you migrate alarms in the TIA Portal from the S7-300/400 to the S7-1500?
In STEP 7 (TIA Portal) V12, why do you have to insert a SET instruction after a jump command in order to ensure a first scan?
Where in STEP 7 (TIA Portal) V11 is there a program for the S7-1200 that lets different bit patterns rotate or flash under time control?
Recommended programming for S7-1200 and S7-1500 with STEP 7 (TIA Portal) V12
In STEP 7 (TIA Portal) V11, how do you calculate a current arithmetic average value from any number of values read in?
In STEP 7 (TIA Portal) V11, how do you calculate the minimum and maximum limit values for a temperature range?
How do you convert degrees into radians and vice versa in STEP 7 (TIA Portal) V11?
In STEP 7 (TIA Portal) V11, how can you buffer the return values from the "RETVAL" parameter consecutively in a DB?
How do you calculate in STEP 7 (TIA Portal) V11 the distance "D" between two points in a rectangular coordinate system?
How do you define a setpoint value with ramp function in STEP 7 (TIA Portal) V11?
How do you establish a MODBUS-RTU communication with STEP 7 (TIA Portal) for the SIMATIC S7-1200?
In STEP 7 (TIA Portal) V11 how can you invert an output signal of the "Bool" data type after each positive edge?
In STEP 7 (TIA Portal) V11, how can you count forwards and backwards in a bandwidth between -2147483648 and +2147483647?
How can you process 64-bit floating-point numbers in STEP 7 V11 with a SIMATIC S7-300/400 CPU?
How can you process 64-bit floating-point numbers in STEP 7 V11 with a SIMATIC S7-300/400 CPU?
Part number:

Description
It is not possible to directly process a 64-bit data type in a SIMATIC S7-300/400 CPU. You must therefore convert it into a different data type for processing. Such a conversion can lead to loss of precision and/or limitation of the value range. These restrictions are caused on the one hand by the reduced data type width of 32 bits and on the other hand by the representation of the approximation of all floating-point formats.

Note
Information about the configuration and the value range of a 64-bit data type (LREAL) is available in the Online Help of STEP 7.

The STEP 7 library attached in this entry for downloading has four functions. These are for converting a 64-bit floating-point number (according to standard IEEE 754) into the data types below

  • DINT (32-bit integer) for integer values (FC2)
  • REAL (32-bit floating point) for broken rational numbers (FC3)

and for converting to a 64-bit floating-point number from the data types below

  • DINT (32-bit integer) for integer values (FC1)
  • REAL (32-bit floating point) for broken rational numbers (FC4)


Fig. 1: Configuration of the STEP 7 program from the attached library

The table below lists the interface parameters of the functions.
 
Name Type

Description

DINT2LREAL (FC1)
IN Input Input of the number value of the DINT data type
OUT Output Output of the number value of the LREAL data type
LREAL2DINT (FC2)
IN Input Input of the number value of the LREAL data type
Ret_Val Return Output of the number value of the DINT data type
STATUS Output Output of the status value*
LREAL2REAL (FC3)
IN Input Input of the number value of the LREAL data type
Ret_Val Return Output of the number value of the REAL data type
STATUS Output Output of the status value*
REAL2LREAL (FC4)
IN Input Input of the number value of the REAL data type
OUT Output Output of the number value of the LREAL data type
Table 1

* The status information is constructed bit for bit. Table 2 lists the descriptions of the separate bits.
 
Bit no. Description
0 LREAL value is greater than zero
1 LREAL value is less than zero
2 Input value is less than zero
3 Input value is greater than zero
4 Loss of information upon conversion
5 Reserved
6 Warning
7 Error
Table 2

The STEP 7 library attached for downloading also contains a monitoring table. You can use this table to give values to the functions.


Fig. 2: Excerpt from the monitoring table

Download

64_bit_conversion.zip ( 462 KB )

Creation environment
The download in FAQ entry was created with the Totally Integrated Automation Portal V11 SP1.

 Entry ID:56098697   Date:2011-11-21 
I regard this article....as helpfulas not helpful                                 
mySupport
My Documentation Manager 
Newsletter 
CAx-Download-Manager 
Support Request
To this entry
Print
Create PDF 
Send to a friend
QuickLinks
Compatibility tool 
Help
Online Help
Guided Tour