Kkula
Who can fix the script?
somehow tag "temperatura" rounded to 1?!
and it is necessary to be in the format of 99.9
(tag "temperatura" Real)
fputs("Temperature: ",fpFile);
sprintf(buffer, "%d",GetTagSDWord("temperatura"));
fputs(buffer,fpFile);
fputs(" C",fpFile);
fputs("\n\r",fpFile);
The script currently displays the "temperatura" tag as an integer, leading to the rounding issue. To fix this and ensure the format "99.9" for a Real tag, modify the sprintf line.
Solution: Replace
sprintf(buffer, "%d",GetTagSDWord("temperatura"));
with
sprintf(buffer, "%.1f",GetTagReal("temperatura"));
Explanation:
GetTagReal("temperatura"): Correctly retrieves the "temperatura" tag as a Real (floating-point) value.%.1f: This format specifier ensures the output is a floating-point number with one digit after the decimal point.Who can fix this?
This script modification can be performed by someone with scripting knowledge within your team familiar with the Siemens environment and access to the script editor. If internal resources are unavailable, consider engaging a Siemens support engineer or a qualified system integrator. You can find support options and partners through SiePortal.
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.