Internet PLC Forum
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Search
Login
Register
Internet PLC Forum
»
General
»
Technical support
»
Saving a 32 bit Integer into two DM[x} variables
« previous
next »
Print
Pages: [
1
]
Author
Topic: Saving a 32 bit Integer into two DM[x} variables (Read 10020 times)
Ben
Guest
Saving a 32 bit Integer into two DM[x} variables
«
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?
Logged
support
Global Moderator
Hero Member
Posts: 3174
Re:Saving a 32 bit Integer into two DM[x} variables
«
Reply #1 on:
March 12, 2004, 02:01:23 PM »
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.
Logged
Email: support@triplc.com
Tel: 1-877-TRI-PLCS
Print
Pages: [
1
]
« previous
next »
Internet PLC Forum
»
General
»
Technical support
»
Saving a 32 bit Integer into two DM[x} variables