473,326 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Capturing Data Using MSComm via serial port

I want to capture the data through serial port using the below program...
The data is 1A2B3C1A2B3C....
From that i want to display A in first text box, B in second text box and C in third text box.
The code which i wrote is giving as B in first text box, 3 in second text box and C in third text box.
COULD U PLS HELP ME OUT.

Private Sub MSComm1_OnComm()

Dim data As String
Dim data1 As String
Dim data2 As String

Dim i As Byte
Dim i1 As Byte
Dim i2 As Byte

If MSComm1.CommEvent = comEvReceive Then

data = MSComm1.Input
data1 = MSComm1.Input
data2 = MSComm1.Input

If Asc(Text) = 32 Then
i = Asc(data)
j = Hex(i)
Text1(0) = j


i1 = Asc(data1)
j1 = Hex(i1)
Text1(1) = j1

i2 = Asc(data2)
j2 = Hex(i2)
Text1(2) = j2

End If
End Sub
Mar 19 '07 #1
0 1182

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Chris | last post by:
Here's the situation: I work at a scientific institution and I have a portable electronic device which is used to take measurements. The device produces a very small amount of numerical data,...
3
by: Sagaert Johan | last post by:
Is there a c# solution for this ? It may work like the MSCOMM control. Applications that use the MSCOMM ocx should distribute this component too, so i want to avoid this. How can serial port...
3
by: dalewz | last post by:
Hi, I am thinking to use C# and MSCOMM in MS VS.net to support GUI and serial port communication. Is this possible? I know that VB and C++ can. Thanks. -Dale
0
by: asam.reddy | last post by:
Hi, I am trying to read serial port using the MSComm control in VS.NET2003(referred from the VS6.0). I have the code already in VB6 which I am coding to C#.NET. After setting all the required...
3
by: Rasha | last post by:
Hi, What is the right way for transmitting data on the serial port of a PC using VB.NET (under XP) ? I used to use the ActiveX MSComm under VB6, which becomes obsolete and needs a...
0
by: pandi | last post by:
Hi, I am using a check scanner.It has functions which gives output like image ,checknumber. i am using serial port to get this output in my coding. My problem is i am not able to read the display...
3
by: cpraveen10 | last post by:
Hi... I am trying to use MSComm for capturing serial data. The serial data is 1A2B3C1A2B3C1A2B3C1A2B3C...... so on which is coming from serial port. From that i have to capture A in the first text...
0
by: cmdolcet69 | last post by:
I get the following error message when I output to the mscomm: An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in COM.exe Additional information: Exception...
0
by: daveman | last post by:
Hello, I'm encountering a "Blue Screen of Death" when I try to send data to a bluetooth sensor via a serial port, using the MSCOMM ActiveX object. I was wondering if anyone has any ideas how to...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.