Click here to Skip to main content
15,888,461 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: how to identify parent form name from a user control Pin
arun_pk7-Apr-09 1:34
arun_pk7-Apr-09 1:34 
GeneralRe: how to identify parent form name from a user control Pin
Henry Minute7-Apr-09 2:21
Henry Minute7-Apr-09 2:21 
GeneralRe: how to identify parent form name from a user control Pin
arun_pk7-Apr-09 2:31
arun_pk7-Apr-09 2:31 
GeneralRe: how to identify parent form name from a user control Pin
Dave Kreskowiak7-Apr-09 3:51
mveDave Kreskowiak7-Apr-09 3:51 
QuestionDesign Advice - How many ways to skin a cat? Pin
RobS237-Apr-09 0:47
RobS237-Apr-09 0:47 
AnswerRe: Design Advice - How many ways to skin a cat? Pin
Tom Deketelaere7-Apr-09 1:15
professionalTom Deketelaere7-Apr-09 1:15 
GeneralRe: Design Advice - How many ways to skin a cat? Pin
RobS237-Apr-09 1:42
RobS237-Apr-09 1:42 
QuestionCRC-CCITT Pin
singende6-Apr-09 22:05
singende6-Apr-09 22:05 
i am developing a VB code to generate CRC-CCITT for my data frame
which is
(0x01 0x10 0x01 0x20 0x02 0xF0 0x04 0x02 0x23 0x10 0x63 0x02 0x03 0xFA 0x33 0x04)
so if i send 0x01 0x10 0x01 0x20 0x02 0xF0 0x04 0x02 0x23 0x10 0x63 0x02 0x03 to a crc-ccitt function i should get crc 0xFA 0x33 which i will add to my data and put an end of header then send via comm port

this what have tried but i am not getting 0xFA 0x33 as required by the protocol


'************************************************************************************
'test with this hex string 0110012002F004022310630203 i am suppossed to get crc FA33
' Or testing with 0110012016F004022310590203 should give crc 5F06
' CRC-CCITT Polynomial: 1021h = x16 + x12 + x5 + 1 (LSB first mode)Start value: FFFFh
'******************************************************************************************


Private Sub CommandButton1_Click()
Dim crc As Long
Dim n As String
Dim values(13) As Byte
Dim k As Integer
Dim i As Integer

crc = &HFFFF&
n = text1.Text

k = 0
For i = 1 To Len(n)
values(k) = "&H" & Mid(n, i, 2)
i = i + 1
k = k + 1
Next i

For k = 0 To 12
crc = calc_crc(crc, values(k))
Next k
MsgBox ("Crc " & Hex(crc))

End Sub

Private Function calc_crc(ByVal crc_buff As Long, ByVal inp As Byte) As Long
Dim i As Integer
Dim x16 As Long
Dim values(13) As Byte
For i = 0 To 12

If ((crc_buff And 1) Xor (inp And 1)) = 1 Then
x16 = &H8408&
Else
x16 = 0
End If
crc_buff = crc_buff \ 2
crc_buff = crc_buff Xor x16
inp = inp \ 2
Next i
calc_crc = crc_buff
End Function

please urgent
QuestionRe: CRC-CCITT Pin
CPallini6-Apr-09 23:33
mveCPallini6-Apr-09 23:33 
AnswerRe: CRC-CCITT Pin
CPallini7-Apr-09 0:10
mveCPallini7-Apr-09 0:10 
GeneralRe: CRC-CCITT Pin
Luc Pattyn7-Apr-09 5:49
sitebuilderLuc Pattyn7-Apr-09 5:49 
GeneralRe: CRC-CCITT Pin
CPallini7-Apr-09 6:47
mveCPallini7-Apr-09 6:47 
GeneralRe: CRC-CCITT Pin
Rajesh R Subramanian8-May-09 20:22
professionalRajesh R Subramanian8-May-09 20:22 
QuestionLOOPING Problem Pin
vijay24826-Apr-09 21:23
vijay24826-Apr-09 21:23 
AnswerRe: LOOPING Problem Pin
Christian Graus6-Apr-09 21:45
protectorChristian Graus6-Apr-09 21:45 
GeneralMessage Closed Pin
6-Apr-09 21:51
vijay24826-Apr-09 21:51 
GeneralRe: LOOPING Problem Pin
Tom Deketelaere6-Apr-09 22:55
professionalTom Deketelaere6-Apr-09 22:55 
AnswerRe: LOOPING Problem Pin
Anubhava Dimri6-Apr-09 21:48
Anubhava Dimri6-Apr-09 21:48 
GeneralMessage Closed Pin
6-Apr-09 22:15
vijay24826-Apr-09 22:15 
GeneralRe: LOOPING Problem Pin
Christian Graus7-Apr-09 0:40
protectorChristian Graus7-Apr-09 0:40 
GeneralMessage Closed Pin
7-Apr-09 1:36
vijay24827-Apr-09 1:36 
GeneralRe: LOOPING Problem[Modified] Pin
vijay24827-Apr-09 1:40
vijay24827-Apr-09 1:40 
GeneralRe: LOOPING Problem Pin
Anubhava Dimri7-Apr-09 1:49
Anubhava Dimri7-Apr-09 1:49 
AnswerRe: LOOPING Problem Pin
Jon_Boy7-Apr-09 5:54
Jon_Boy7-Apr-09 5:54 
AnswerRe: LOOPING Problem Pin
Skymir8-Apr-09 4:09
Skymir8-Apr-09 4:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.