|
-
Nov 20th, 2009, 01:02 AM
#1
Thread Starter
New Member
VB6.0: MSComm gives me ascii character but i need single data type !!
Hello , i am new to VB 6.0 and the code i am working on works on sigle data type and i am using serial communication that send me ascii numbers and i need to convert the ascii to single. The Code is :
Private Sub WithoutGE_Click()
Dim serialflag As Boolean
Dim serportname As String
If MSComm1.PortOpen Then
MSComm1.PortOpen = False
End If
MSComm1.CommPort = 5 'Defined COM port available on PC
MSComm1.InputLen = 1
MSComm1.Settings = "115200, N, 8, 1"
MSComm1.PortOpen = True
End Sub
Private Sub MSComm1_OnComm() 'on serial event
If (MSComm1.CommEvent = comEvReceive) Then ' if something received
'serialData = MSComm1.Input shows me data type is byte i have mismatch error
'serialdata is variant error is not observed
serialByteData = MSComm1.Input
End If
End Sub
What should i do need help . Ascii to Byte and Byte to single ! but how !???
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|