473,788 Members | 2,706 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help!- MSComm Control Madness

Hi All,

I have 16 bytes 0x02, then "0F0270632E 30" 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)

HELP
-----------
Using the PC with VB6 and Studio I can receive the data correctly OK

BUT.....

When I deploy the VB6 on to another PC the serial data received is in
correct.
Length of VarchrBuff on the deployed PC is 14 but should be 16?????

Both PCs run XP

Any help would be appreciated

MSComm1.InputLe n = 0
MSComm1.InBuffe rSize = 1024
MSComm1.RThresh old = 12 ' Expect more than 12

MSComm1.InputMo de = comInputModeBin ary ' BINARY MODE
MSComm1.OutBuff erSize = 1024

MSComm1.SThresh old = 0
'MSComm1.SThres hold = 512

'Handshaking options:
MSComm1.Handsha king = comNone
'Open the port.
If MSComm1.PortOpe n = False Then
MSComm1.PortOpe n = True
End If

MSComm1.InBuffe rCount = 0
End Function

MSComm1_OnComm( ) in the receive code is as follows

Dim ComEventMessage As String
Dim StartPos, EndPos, i As Integer
Dim tagASCIIhex As String
Dim TagCRC As Byte
Dim VarchrBuff As Variant
Dim bytearray() As Byte
..
..

Case comEvReceive
ComEventMessage = "Receive buffer has RThreshold number of
characters."
If MSComm1.InBuffe rCount > 0 Then
VarchrBuff = MSComm1.Input: ' Get serial
data
MSComm1.InBuffe rCount = 0 ' Now we have data flush Rx buffer
StartPos = 0: EndPos = 0
bytearray() = VarchrBuff

For i = 0 To (LenB(VarchrBuf f) - 1)

If bytearray(i) = 2 Then StartPos = 1: bytearray(i) = 32
If bytearray(i) = 3 Then EndPos = i: bytearray(i) = 32
Print "byte i = "; i; " byte = "; bytearray(i); " char ";
Chr(bytearray(i ))

Next i
Print "LenB(VarchrBuf f) = "; LenB(VarchrBuff )
End if

Oct 24 '05 #1
0 7617

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
398
by: stacy | last post by:
I used the wizard to upgrade an application from VB 6 to VB.net, the following warnings appear around the .Input method of the MSCOmm control 'UPGRADE_WARNING: Couldn't resolve default property of object MSComm1.Input. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1037"' When running the application, the following dialog comes up when a character is written to the .Output method "An unhandled...
1
3530
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
7347
by: jiatiejun | last post by:
I add the MSComm control in my C# program, but I can't get byte data, only to get string data; there are some problem when char >126 or <32 How to access NO ASCII char (for examples: like UNICODE Chinese, Japanese...) like a char ?
1
1912
by: pcserver | last post by:
How to add MSComm Control in #develop MSComm COM/OCX control.
8
1665
by: Bob | last post by:
This is a bug that affects all controls, not just the ones that it's screwing up in my app. I really need a workaround. Anyone? Please? Before I regret letting my MSDN subscription run out and pay the hundred bucks or so to get MS tech support so they can tell me how to get around their own bug? Bob P.S. I meant to say "there are only two messages for mouse <movement> events" "Bob" <noemail@nospam.net> wrote in message
6
6620
by: Barry Martin | last post by:
I am using an activex control mscomm to control a serial port in VB.NET. I place the control on the main form and set its port, baud rate, etc. properties. After creating a code module that needs to access the serial port, I cannot seem to be able to access the mscomm control from within a code module. In VB6 you could use the statement frmMain.Mscomm1.output = "some data string" in the code module but this won't work in VB.NET. Does...
1
2602
by: Barry | last post by:
I am using the mscomm activex control in vb.net. I can add the control to the toolbar which will allow me to drop it onto a form. As long as I am in the code space for that form it works fine. When I try to output some text to the serial port via AxMscomm1.output = "some text" within a code module, the compiler says that AxMscomm1 is not defined. Can anyone tell me how I pass a reference to the mscomm control located on one form from...
6
8222
by: Tico Tech | last post by:
Hi: I have a question about the Microsoft Communications Control Version 6.0 from visual studio .net. I have this code: Dim Buffer As String Do Buffer = AxMSComm1.Input() //Error, it does not recognize this statement. Loop Until Len(Buffer) > 0
4
5519
by: ifitzgerald | last post by:
Hi, I am modifying a rather large and complex MFC application (written by someone else) written in Visual C++ 6.0 with service pack 6. I need to add serial communication functionality to the program, and since I am very familiar with the Microsoft Comm Control from Visual Basic I decided that I would use that in this application. To make things easier on myself, I decided to make several test applications using the MS Comm control in VC++...
0
9498
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10177
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10113
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8995
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5402
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4074
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
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.