Ask our Experts
Didn't find what you are looking for? Ask our experts!
New Community Ranking System
Our Community ranking system has recently been updated. You may notice changes in user rankings and receive system messages or notifications. If you have questions about how the new ranking works, please refer to the announcement post for more details (click here).
Support Forum for HVAC and pumping machines, Modicon M17x and EcoStruxure Machine Expert HVAC software for chillers, AHU, CRAC units for datacenters or process chillers applications - from design, implementation to troubleshooting and more, by Schneider Electric.
Search in
Please select a country to continue with beta search.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2026-07-19 08:41 PM
Hi,
I am able to reliably cause a watchdog violation in Timed task due to having a large unused local variable in a function. See function below.
FUNCTION stack_overflow: BOOL
VAR
test_string : STRING[ 3200 ];
END_VAR
stack_overflow := TRUE;
RETURN;
and the Timed program
I set 'test' true via Debugging. A string of 3200 characters is pretty big but in my project that I first noticed this, I had a couple of strings ~64 characters long, but still not used in code.
Should the compiler determine that this variable is not used, and not compile it in to code?'
This is with EcoStruxure v1.10.0 for BIOS 668.17.
Thanks!
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2026-07-22 01:26 AM
Hello,
variable allocation is optimized for POU, Function Block and global variables.
I confirm that in case of functions all declared variables are allocated regardless of their usage.
At the moment, it is not in the roadmap an optimization of the compiler for this topic, it might be planned a stack control in the future bios version (not defined yet in which bios version).
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2026-07-22 01:26 AM
Hello,
variable allocation is optimized for POU, Function Block and global variables.
I confirm that in case of functions all declared variables are allocated regardless of their usage.
At the moment, it is not in the roadmap an optimization of the compiler for this topic, it might be planned a stack control in the future bios version (not defined yet in which bios version).
Link copied. Please paste this link to share this article on your social media post.
You’ve reached the end of your document
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.