Wrox Programmer Forums
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 19th, 2004, 10:57 AM
Authorized User
 
Join Date: Nov 2004
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default OnComm() not working ???

I everybody

I'm doing a little programm to communicate with the serial port now Im able to send data and also receive data. My problem is that Im using the OnComm() event but it don't seem to work.But I now that I receive data. See my code...

First I'm initializing the port and it work well with this function:

If MSComm1.PortOpen = False Then
        'Open COM1
        With MSComm1
            .CommPort = 1 'Port number
            .Settings = "9600,N,8,1" ' 9600 Baud, No Parity, 8 Data Bits, 1 Stop Bit
            .RThreshold = 2 ' Fire Rx Event Every Two Bytes
            .InputLen = 2 ' When Inputting Data, Input 2 Bytes at a time
            .PortOpen = True
        End With
    End If

Then I use this Sub which never get launch even if I receive data and I can see those data, I really receive it. What is the problem???

Private Sub MSComm1_OnComm()
    'If comEvReceive Event then get data and display
    If MSComm1.CommEvent = comEvReceive Then
        strReceiveBuffer = MSComm1.Input
        MsgBox strReceiveBuffer, vbOKOnly
    End If
End Sub


Thank you
Johnjohn






Similar Threads
Thread Thread Starter Forum Replies Last Post
window.opener working .... not working alyeng2000 Javascript How-To 5 January 5th, 2007 08:05 AM
Web.Config..Working or Not Working peace95 ASP.NET 1.0 and 1.1 Basics 1 September 18th, 2006 06:53 AM
Local COM working , but not working at Web Serv nagen111 .NET Web Services 3 February 19th, 2005 04:22 AM
Example not working CKucler BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 3 December 8th, 2004 11:26 AM
Get Working Copy... not working Enkiel Classic ASP Basics 0 April 21st, 2004 01:41 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.