DWORD can indeed be converted to a DINT as both are 32bit values.
The DIV function only takes “any_num” as inputs.
On the DIV-input you can try this: TO_DINT(myDWORD), and your constant at the other input
Have you tried something like this?
SFW
Have you tried something like this?</p>[https://forum.plcnext-community.net/uploads/DLWJ8IJ24QGN/image.png</a></p>SFW</p>
[upload://qpe1aVsFY5bikU2042xnbi6NDm6.png</a></p>DWORD can indeed be converted to a DINT as both are 32bit values.</p>The DIV function only takes “any_num” as inputs.</p>On the DIV-input you can try this: TO_DINT(myDWORD), and your constant at the other input</p>[upload://lFr9IRqwvpC3hSaOg5jhGEMkVE2.png</a></p>[upload://ta8HWWfYGaYxSo1VaQFuBCuv4n1.png</a></p>
Hello Steve,
Hello Fluxmodel,
I truly appreciate your support, thank you very much.
Initially, when I tried to convert a DWORD to a DINT, the output value was incorrect and appeared with a negative sign. However, after restarting the software and reading your comment that both DWORD and DINT are 32-bit, I tried the conversion again, and it’s now working correctly. I simply converted the DWORD to a DINT and assigned the DINT to the DIV block. Thanks again for your assistance.
Regards,
Ali
FYI a negative sign for a DINT is not incorrect… it ranges from
-2,147,483,648 to 2,147,483,647