473,545 Members | 2,019 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MSComm receive data

3 New Member
Hello

Im using the MSComm to send and receive binary data to a video server, the sending part works fine, but when a receive more than 8 byets, the input variable only keeps the bytes over the eighth byte. ...Please some can some one tell me where im wrong??? these are the settings and the OnComm part

MSComm1.CommPor t = 1
MSComm1.Setting s = "38400,O,8, 1"
MSComm1.InputMo de = 1
MSComm1.InputLe n = 0
MSComm1.RThresh old = 1
MSComm1.SThresh old = 1
MSComm1.DTREnab le = True
MSComm1.RTSEnab le = True
MSComm1.NullDis card = False
If MSComm1.PortOpe n = False Then
MSComm1.PortOpe n = True
End If



Private Sub MSComm1_OnComm( )
Dim buffer As Variant
Dim Arr() As Byte
Dim i As Integer
Dim iTemp As Integer
Dim sTemp As String
Dim strINPUT As String

Select Case MSComm1.CommEve nt
Case comEvReceive
Do While MSComm1.InBuffe rCount > 0
buffer = MSComm1.Input
Arr = buffer

For i = LBound(Arr) To UBound(Arr)
iTemp = Asc(Chr$(Arr(i) ))
sTemp = Hex$(iTemp)

If Len(sTemp) = 1 Then 'For display in a text box
strINPUT = strINPUT & "0" & sTemp & " "
Else
strINPUT = strINPUT & sTemp & " "
End If

Text1.Text = strINPUT

Next
Loop
Jan 4 '07 #1
0 1549

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

Similar topics

0
7590
by: Joe G \(Home\) | last post by:
Hi All, I have 16 bytes 0x02, then "0F0270632E30" then <CR> then <LF> then 0x03 that are received by the serial port of my PCs. The only variation is the string ASCII hex values I know my serial port works on all machines as the data is correct in Hyperterminal (9600, N, 8,1)
1
3509
by: Peter Krikelis | last post by:
Hi, I am trying to develope a User Control Library that features MScomm control. I test my user control in a test application. When I run the application I receive the following: An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in axinterop.mscommlib.dll
1
3853
by: caid | last post by:
Hi there. I'm writing a C# app (in VS.NET 2003) that sends a binary sms using MSComm. I got it going with a gsm modem, but ideally we want to use a cellphone as the sending device. However, when I use a cellphone (Nokia 7210) with the same code, I get the above exception. The first communication with the phone is as follows: ...
9
9042
by: Carl Gilbert | last post by:
Hi I'm trying to open a vb6 project in vb.net which uses the mscomm component. When running the vb upgrade wizard in vb.net, an error is raised: Upgrade failed, unable to load reerenced component mscomm32.ocx (1.1.0) You need to install this component before you upgrade the project. Does anyone know how to install the mscomm component.
1
7453
by: Recep TARAKÇI | last post by:
hi everbody i am using visual basic 2005. i am write a modem control program and get callerID value. i am send a AT command to modem. Dim mscomm1 As New MSCommLib.MSComm mscomm1.CommPort = 3 mscomm1.PortOpen = True
0
1299
by: philipmact | last post by:
Dear ALL: i'm currently facing one problem, the problem is how can i receive my tag ID from the RFIDreader to the MSCOMM? can anyone give me some idea? My idea are shown as below~ http://www.freeimagehosting.net/uploads/th.88e1f87602.jpg Thank you~
2
2103
by: cpraveen10 | last post by:
Hi All... I am using MSComm to receive data serially in a text box. The data being recieved is 1A2B3C1A2B3C1A2B3C...........so on... I have read this into a text file. So I am now getting 1A2B3C1A2B3C1A2B3C...........so on...in the text file.Now I have to get as 1A 2B 3C 1A 2B 3C 1A 2B
0
1787
by: danishce | last post by:
Hello All: I am receiving data in hex format using serial communication MSCOMM control.The data reads ok but when it find hex(0) means EndofFile character in ASCII it exits and does not read data after the EndofFile character. The code for receiving hex data is: Private Sub MSComm1_OnComm(ByVal sender As Object, ByVal e As System.EventArgs)...
1
2889
by: dbrother | last post by:
Hello, I have a program in Access that uses VBA to capture data being sent over the serial port from a Cosmo Flow Test Machine. This determines the air pressure's leak rate escaping from a muffler. I have written several programs that send data out serially, but I am new to "listening" to receive the data. I can setup an instance of...
0
7468
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7401
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7808
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7757
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
3450
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3443
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1884
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1014
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
704
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.