So word16 is an integer. high_byte is a member of byte_low_hi. So
word16.high_byte is something that doesn't exists.
I'm not sure how you would like to approach this :
- you could declare word16 as an integer (or short for a 16 bit value ???)
and extract the parts as needed
- you could declare word16 as a byte_low_hi and compute the corresponding 16
bit value as needed
- you could perhaps even declare a union (that is two structure that shares
the same underlying memroy area to access this a 16 bit value or as two
bytes depending on your needs; not remember to have tried this with .NET)
Another option would be to explain what you are trying to do in case somone
would suggest another simpler approach.
--
Patrice
"cmdolcet69" <
[email protected]> a écrit dans le message de (e-mail address removed)...
What is word16 ? Is it an integer rather than a byte_low_hi ?
---
Patrice
"cmdolcet69" <
[email protected]> a écrit dans le message de (e-mail address removed)...
- Show quoted text -
These are all my declarations:
Public Class GlobalMembers
Public Array_AVG As ArrayList
Public com1 As MSCOMM
' Global Union Variables:
Public Shared crc_value As word_byte ' system crc value
Public Shared adc_value As word_byte ' adc value read from
table
Public Shared location_value As word_byte ' address of table
to send ADC value
Public Shared pmsg As Byte() = New Byte(24) {} ' crc buffer
Public Shared tsize As Integer
Public Class byte_low_hi
Public low_byte As Byte
Public high_byte As Byte
End Class
Public Structure word_byte
Public word16 As Integer
Public byte8 As byte_low_hi
End Structure
'Code Constants
'#Const BMS = True ' this represents the binary
message start byte, value 0x2A
'#Const PASSWD = True ' this represents the factory
pass code, value 11548d
'#Const POLY = True ' the polynomial used in the CRC
algorithm
Public Const BMS As Char = "*"c
Public Const PASSWD As Integer = &H2D1C
Public Const POLY As Integer = &H8005