473,387 Members | 1,863 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,387 software developers and data experts.

OnCOmm event does not trigger.

I have a basic program to test key click and reception of data on RS232 port. Computer1 is running this program and computer2 is running hyperterminal. When I send the data out from computer1, i can see the data on computer2; however, no onComm event triggers when data is received. KeyClick does not work either.
Does anyone know what needs to be modified?

Thanks in advance.
Boomer

--------------------------CODE---------------------------------
Expand|Select|Wrap|Line Numbers
  1. Imports MSCommLib.OnCommConstants
  2.  
  3. Public Class Form1
  4.  
  5.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  6.         AxMSComm1.CommPort = 1 ' Use COM1.
  7.         AxMSComm1.Settings = "9600,N,8,1" ' 9600 baud, no parity, 8 data,
  8.         ' and 1 stop bit.
  9.         AxMSComm1.InputLen = 0 ' Read entire buffer when Input
  10.         ' is used
  11.         AxMSComm1.PortOpen = True ' Open port
  12.     End Sub
  13.     Private Sub Form1_KeyPress(ByVal KeyAscii As Integer)
  14.         AxMSComm1.Output = KeyAscii
  15.         TextBox1.Text = KeyAscii
  16.         AxMSComm1.Output = "This is tested"
  17.     End Sub
  18.  
  19.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  20.         End
  21.     End Sub
  22.  
  23.     Private Sub AxMSComm1_OnComm(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AxMSComm1.OnComm
  24.         If (AxMSComm1.CommEvent = comEvReceive) Then
  25.             TextBox2.Text = AxMSComm1.Input
  26.         End If
  27.     End Sub
  28.  
  29.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  30.         AxMSComm1.Output = "This is tested \n \r "
  31.         'Dim inputt As String
  32.         'While (1)
  33.         '    inputt = AxMSComm1.Input
  34.         'End While
  35.  
  36.     End Sub
  37. End Class
Nov 18 '09 #1
0 1487

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

Similar topics

3
by: Clarence Gardner | last post by:
I'm seeing surprising behavior, consistent across Opera, Firefox, and IE. An event handler is changing the value of an element, and there is apparently no Change event being generated for the...
8
by: Steve Schroeder | last post by:
For some reason I cannot get the OnSelectedIndexChanged event to fire for a listbox I have on a page. I'm able to populate the listbox with data from a stored procedure, but cannot trigger the...
5
by: Verde | last post by:
This is admittedly an apparently odd request... but please indulge me if you don't mind: Suppose I have two <asp:Button.../> on a page (Button1 and Button2). User clicks Button1 and triggers a...
3
by: George | last post by:
Hi, I have searched on the net quite a bit, but the more I read, the more confused I get. I want to see if I can raise an event out side of the class. I believe this can be done in VB (at...
19
by: Daniela Roman | last post by:
Hello, I try to fire an event under a button click event and maybe anybody can give a clue please. I have let's say a WEB grid with PageIndexChanged event: private void...
2
by: Alan Mailer | last post by:
Ok, I'm pretty new to VB.Net, so please bear with me. Imagine the Load event of one of my forms includes the following: Dim ctrl as Control Dim txtbox As TextBox For Each ctrl In Me.Controls...
1
by: Alan Mailer | last post by:
Ok, I'm pretty new to VB.Net, so please bear with me. Imagine the Load event of one of my forms includes the following: Dim ctrl as Control Dim txtbox As TextBox For Each ctrl In Me.Controls...
5
by: Tenacious | last post by:
I am trying to shutdown a database server in the Application_End event handler on the Global.asax page. So far I am trying this only on the development server that comes with Visual Studio 2005....
1
by: Roman Bystrianyk | last post by:
I'm trying to get a comm port working from a javascript using an ActiveX control. The port is basically working where I can receive input from the serial port. BUT - I can't seem to get the...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.