I'm having issues with the code below. I get the message that Uinteger is not defined. I need to make this data type as a unsigned integer. -
Public Class GlobalMembers
-
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 UInteger
-
' Global Structure Definitions
-
Public Class byte_low_hi
-
Public low_byte As Byte
-
Public high_byte As Byte
-
End Class
-
' Global Union Definitions
-
'C++ to VB CONVERTER TODO TASK: Unions are not supported in VB.
-
'ORIGINAL LINE: union word_byte
-
Public Structure word_byte
-
Public word16 As UInteger
-
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
-
Friend NotInheritable Class DefineConstants
-
Public Const BMS As Char = "*"c
-
Public Const PASSWD As Integer = &H2D1C
-
Public Const POLY As Integer = &H8005
-
End Class
-
Public Sub table_upload_req()
-
Dim Len As Byte = &H8
-
Dim Cmd As Byte = &H9
-
adc_value.word16 = &H0 ' read ADC value and put into storage var
-
location_value.word16 = &H0
-
crc_value.word16 = 0
-
-
Dim msg_size As Byte = Len - 2
-
-
pmsg(0) = AscW(Len)
-
pmsg(1) = AscW(Cmd)
-
-
Dim i As Integer = 0
-
Do While i < tsize
-
-
' single table upload request packet
-
location_value.word16 += 1
-
adc_value.word16 = ADC_AVE(i)
-
-
pmsg(2) = CChar(adc_value.word16.high_byte)
-
pmsg(3) = CChar(adc_value.word16.low_byte)
-
pmsg(4) = CChar(location_value.word16.high_byte)
-
pmsg(5) = CChar(location_value.word16.low_byte)
-
-
crc_value.word16 = Make_Bitwise_CRC16(Of UInteger, msg_size)()
-
com1.Output = DefineConstants.BMS + pmsg(0) + pmsg(1) + pmsg(2) + pmsg(3) + pmsg(4) + pmsg(5) + CChar(crc_value.word16.high_byte) + CChar(crc_value.word16.low_byte)
-
tsize += 1
-
Loop
-
End Sub
-
Public Function Make_Bitwise_CRC16(ByVal msg_size As UInteger) As Integer
-
Dim i As UInteger
-
Dim j As UInteger
-
Dim msg As UInteger
-
For i = 0 To msg_size - 1
-
msg = (pmsg(i) << 8)
-
For j = 0 To 7
-
If ((msg Xor crc_value.word16) >> 15) > 0 Then
-
crc_value.word16 = (crc_value.word16 << 1) Xor DefineConstants.POLY
-
Else
-
crc_value.word16 <<= 1
-
End If
-
msg <<= 1
-
Next j
-
Next i
-
Return (crc_value.word16 Xor 0)
-
End Function
-
End Class
-
1 1879
As they told you on PC Review, in VB2003, you do not have UInteger keyword. You must use System.UInt32.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: David Lee |
last post by:
Need some help bad here. Am using VB.Net Standard 2003 supplied for
a class and I need to install Msde and the sample databases to work on
homework. Following the documentation I can download...
|
by: Wolfgang Kaml |
last post by:
Hello All,
I have been working on this for almost a week now and I haven't anything up
my sleeves anymore that I could test in addition or change....
Since I am not sure, if this is a Windows...
|
by: MarionEll |
last post by:
Premier XML Industry Event Slated for Dec. 7-12 in Philadelphia; Presenters
Include Adobe, BEA, Microsoft, IBM, Sun, Hewlett-Packard, Oracle
Alexandria, Va. Sept. 30, 2003 - IDEAlliance, a...
|
by: MarionEll |
last post by:
Premier XML Industry Event Slated for Dec. 7-12 in Philadelphia; Presenters
Include Adobe, BEA, Microsoft, IBM, Sun, Hewlett-Packard, Oracle
Alexandria, Va. Sept. 30, 2003 - IDEAlliance, a...
|
by: David Waz... |
last post by:
Moved an app from W/2000 Asp V1.0 to
W/2003, VS/2003, ASPV 1.1
Page runs a long job, uploading 2 large fixed length files
(300,000 rows) into SQL database. A process is run
against the data,...
|
by: EP |
last post by:
When running my asp.net hosting service (asp.net without IIS), on server
2003 with IIS not installed, I get the following when trying to process a
request.
"System.DllNotFoundException: Unable to...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |