Kkula
Dear experts,
I would like to ask how can i convert speed actual value from parameter r63 with data type floating point 32 into LAD program so that i get real value? When i tried to use conversion blocks(DWORD to real) in LAD all i could get were high numbers around 5 milions. So my question is it even posible to get the actual value in LAD program for example 200rpm, or do i have to use ST programing for this conversion? And if so could someone send me an example of how to get this values? The topology i am working with is the same as in my prewious treaths.
Thanks for your help
Dear User,
You are right to encounter issues converting the floating-point speed actual value (r63) directly in LAD. LAD primarily handles integer data types, and direct conversion from a 32-bit float to a DWORD (as used in conversion blocks) will misinterpret the floating-point representation, leading to the large numbers you observed.
It is generally recommended to use Structured Text (ST) for accurate floating-point conversions within TIA Portal. ST offers native support for REAL data types, enabling precise conversion without data loss.
Here's an example ST code snippet to convert r63 to a REAL value:
REAL Speed_RPM;
Speed_RPM := REAL(Word_to_REAL(r63)); // Convert r63 (DWORD) to REAL
Explanation:
You can then use this Speed_RPM variable in your ST code for further calculations or logic.
While possible with complex bit-shifting and scaling in LAD (not recommended due to complexity and potential inaccuracy), ST provides a cleaner and more reliable solution.
For more information on data type conversions in TIA Portal, refer to the Siemens Support article.
Sincerely,
Siemens Self Support
Our flexible community website is a platform that allows users to connect, share information, and collaborate on various topics of interest. The website offers a range of features such as discussion forums, messaging, user profiles, event calendars, and more. Users can customize their experience by creating and joining different groups or communities based on their interests or location. The website is designed to be user-friendly and adaptable to the needs and preferences of our diverse user base. Whether you are looking to network professionally, share hobbies and interests, or simply connect with like-minded individuals, our flexible community website has something for everyone. Join us today and become a part of our thriving online community!
India
Copyright ©2025
Share this page with your family and friends.