Ask our Experts
Didn't find what you are looking for? Ask our experts!
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
Link copied. Please paste this link to share this article on your social media post.
Posted: 2025-09-10 09:18 PM
Hi,
Under some software testing, I have observed that adding two UINTs and comparing with lesser than on a single line has different behaviour to the same code split to multiple lines.
See below.
Variables are prefixed with 'ui' for UINT, 'x' for BOOL.
I assume there is some casting going on in the background.
What causes the casting? I would like to avoid this issue now, and if I run into in the future.
This was tested on simulation on ESME HVAC v1.7.0, Windows 11, target M172PDG18R with 668p15 BIOS.
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: 2025-09-11 11:43 PM
I would expect in the first case the PLC use the sum which has then a 32Bit size.
Did you get a waring? Normally I would expect that you get in that case a warning about the data typ.
In the seconde try you get an overflow of the value which set the value back to 0. Because in the second version you have the datatyp for the result fixed. In the first version the datatyp for the result is choosen by the compiler.
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: 2025-09-11 11:43 PM
I would expect in the first case the PLC use the sum which has then a 32Bit size.
Did you get a waring? Normally I would expect that you get in that case a warning about the data typ.
In the seconde try you get an overflow of the value which set the value back to 0. Because in the second version you have the datatyp for the result fixed. In the first version the datatyp for the result is choosen by the compiler.
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: 2025-09-14 04:14 PM
Hi @Bastian_Schmitz,
I believe you are right RE 32 bit size.
I did not receive a warning. I set 'Enable verbose warning mode' on in the Project Options; no warning either.
I wanted to deliberately overflow, and explicitly casting did not seem to work.
I'll leave my original code split to two lines to avoid the implicit cast.
Thanks!
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.