LREAL
LREAL means Long Real — a 64-bit IEEE 754 double-precision floating-point data type with about 15-16 decimal digits of precision. Used when REAL's 7-digit precision is insufficient.
Key Takeaways
- LREAL means Long Real — a 64-bit IEEE 754 double-precision floating-point data type with about 15-16 decimal digits of p...
- Intermediate-level topic in Data Types & Variables
- Commonly used in: Industrial process control, Machine automation
- Related to: REAL, Floating Point, BOOL
Detailed Definition
**LREAL (Long Real) is a 64-bit double-precision floating-point** type following the IEEE 754 standard. Used when 32-bit REAL's ~7 decimal digits of precision are insufficient.
**Range:** approximately ±1.8 × 10³⁰⁸ with about 15-16 significant decimal digits of precision.
**Memory:** exactly 8 bytes (64 bits): 1 sign bit, 11 exponent bits, 52 mantissa bits.
**Common uses:** high-resolution sensor calibrations, accumulated totals (where REAL would lose precision after years of running), scientific or financial calculations, GPS coordinates (lat/lon needing <1 meter precision globally), motion control profiles requiring sub-micron resolution.
**Syntax across major IDEs:** - Siemens SCL: `bigValue : LREAL := 0.0;` - Studio 5000: limited support (v32+); use REAL by default - CODESYS / TwinCAT: `bigValue : LREAL := 0.0;`
**Common pitfalls:** scan-time cost — 64-bit floating-point operations are 2–4× slower than REAL on most PLC CPUs; LREAL conversions to/from REAL are lossy; same comparison-with-`=` pitfalls as REAL.
**See also:** REAL (32-bit single precision), LINT (64-bit integer), ANY_REAL.
Why It Matters
Understanding LREAL is important in PLC programming and industrial automation. This concept plays a vital role in:
- Industrial process control
- Machine automation
- System monitoring and diagnostics
- Data processing and management
Mastering this important concept will enhance your ability to design, implement, and troubleshoot industrial automation systems effectively.
Real-World Use Cases
LREAL is applied across various industrial automation scenarios:
Industrial process control
Machine automation
System monitoring and diagnostics
Data processing and management
Practical Examples
Here are real-world examples of how LREAL is implemented in industrial settings:
Using LREAL in a packaging machine control system for product handling and quality inspection
Implementation of LREAL in HVAC control for optimizing energy consumption and comfort
Pro Tip: These examples demonstrate common implementation patterns. Adapt them to your specific application requirements and PLC platform.
Common Questions
What is LREAL?
LREAL means Long Real — a 64-bit IEEE 754 double-precision floating-point data type with about 15-16 decimal digits of precision. Used when REAL's 7-digit precision is insufficient.
When should I use LREAL?
LREAL is particularly useful in scenarios such as Industrial process control and Machine automation. Consider implementing it when you need reliable, efficient solutions for these types of applications.
What are related concepts I should learn?
To fully understand LREAL, you should also familiarize yourself with REAL, Floating Point, and BOOL. These concepts work together in industrial automation systems.
Continue Learning
Ready to deepen your understanding of LREAL? Here are some recommended resources:
Was this helpful?
Let us know if this glossary term helped you understand LREAL better.
Your feedback helps us improve our glossary and create better content for the PLC programming community.
Quick Info
- Category
- Data Types & Variables
- Difficulty
- Intermediate
- Tier
- Important
About Data Types & Variables
Data structures, variable types, and memory organization