I have two problems:
1. In adding an MSComm1 to this existing code, I have apparently stopped whatever code was controlling the serial port. I have tried to:
Call getCommPort
to get the original communications restarted, but I get:
ambiguous name detected: getCommPort
If I knew how to use the existing comm system without MSComm1, I'd to that, but I think that will be way beyond my current capabilities.
'FLOW DATA
Private Sub Form_Load()
With MSComm1
' First we initialize a few properties.
' Set the COM port number.
.CommPort = 1
' The communication settings. The values are:
' baud rate, parity, data bits, stop bits.
.Settings = "9600,n,8,1"
' Recieve and send thresholds, described below.
.RThreshold = 1
.SThreshold = 1
' Open COM1 and begin communications.
.PortOpen = True
' Send the string "some data" to the output buffer.
.Output = "464c4f57"
' Get the current contents of the input buffer.
If (MSComm1.InBufferCount > 0) Then
flowdatastr = MSComm1.Input
Else
flowdatastr = ""
End If
End With
Close MSComm1
Call getCommPort
End Sub
This is the top of the serialcomm(serialcomm.bas) form:
Option Explicit
Public Sub getCommPort()
My second problem is displaying the data I get from MSComm1 without clicking the label1 box. The correct data comes up, but I don't want to click the box to get it.
Public flowdatastr As String
Private Sub Label1_Click()
End Sub
Thanks,
Gary
1. In adding an MSComm1 to this existing code, I have apparently stopped whatever code was controlling the serial port. I have tried to:
Call getCommPort
to get the original communications restarted, but I get:
ambiguous name detected: getCommPort
If I knew how to use the existing comm system without MSComm1, I'd to that, but I think that will be way beyond my current capabilities.
'FLOW DATA
Private Sub Form_Load()
With MSComm1
' First we initialize a few properties.
' Set the COM port number.
.CommPort = 1
' The communication settings. The values are:
' baud rate, parity, data bits, stop bits.
.Settings = "9600,n,8,1"
' Recieve and send thresholds, described below.
.RThreshold = 1
.SThreshold = 1
' Open COM1 and begin communications.
.PortOpen = True
' Send the string "some data" to the output buffer.
.Output = "464c4f57"
' Get the current contents of the input buffer.
If (MSComm1.InBufferCount > 0) Then
flowdatastr = MSComm1.Input
Else
flowdatastr = ""
End If
End With
Close MSComm1
Call getCommPort
End Sub
This is the top of the serialcomm(serialcomm.bas) form:
Option Explicit
Public Sub getCommPort()
My second problem is displaying the data I get from MSComm1 without clicking the label1 box. The correct data comes up, but I don't want to click the box to get it.
Public flowdatastr As String
Private Sub Label1_Click()
End Sub
Thanks,
Gary