You'd better operate on numbers with the same data type and word length, or you may make mistakes.
For example, you define a BCD number of 16 bits in PLC, such as D 1, and a 32-bit unsigned integer, that is, an unsigned long integer, such as D2 (actually D2 occupies the words D2 and D3), that is, four consecutive registers. D 1 is directly added to D2 without data conversion, and some PLCs may make mistakes, because it is possible to add D 1 to the high 16 bit of D2, which is a low-level error of PLC manufacturers, but some PLCs do have such errors. You'd better convert D 1 into a 32-bit unsigned long integer, such as D5, and then add D2 to ensure this. Having said so much, I don't know if you understand. If you have time, you'd better look at the principle of microcomputer and you'll understand after reading it. It must be good for the future!