Internet PLC Forum
General => Technical support => Topic started by: Ben on March 12, 2004, 11:55:09 AM
-
What is the simplest method of breaking a 32 bit integer into 16 bit halves and saving them to the DM
- array? The Functions GETHIGH16(x) and SETHIGH16 v,data are used for the upper 16 bits. How do we handle the lower 16 bits? Mask out the upper 16 bits by "AND FFFF0000" and assign to the DM
- variable?
-
When you assign a 32-bit variable to a 16-bit variable, only the lower 16 bit will be assigned. So there is no need to do a logical AND to mask out the upper 16-bit.