rmcleod -
It is not the application that is unable to send information to the device. It is the MSComm Control used by the application.
I have not coded in VB6 in a number of years so my skills are a little rusty. I should have had the code in magenta in the example I provided to you (Original Old Project). This should now display the error message the MSComm control is generating.
The error you are seeing, has something to do with the MS Comm Controls inability to connect to your device. Either the device is open with some other software, the configuration on the device changed.
The application errors out on
gfrmComms.MSComm(iCurrCommControl).Settings = ("19200,n,8,1") - which is then jumps down to the
Skip_This_Comm:
If you have multiple LCD Dispalys, I would try to connect another one and see if you can connect to that one - or change the Comm port to a different port.
Debuggin Project Group (Solution) is very simular to debugging a single project. Place a break point on the line where you want the application (in any of the projects) to break and when the application breaks use F5to step through it or F8 to step into it. If you are unable to step into the code - it mean you are referencing a version of the compiled DLL and not the Project.
The reason the Device works fine with the 635wintest application probably is because they are using an API to connect to the device or they are querying the device using APIs to get the comm settings.
Code:
'*******************************************
' AssignCommControls
'*******************************************
Private Sub AssignCommControls()
Dim iCommControlsNeeded As Integer
Dim iCnt As Integer
Dim i As Integer
Dim oLcd As LcdDisplay
Dim iCurrCommControl As Integer
iCurrCommControl = 0
For i = 1 To mCol.Count
On Error GoTo Skip_This_Comm
Set oLcd = mCol(i)
If Not oLcd Is Nothing Then
If iCurrCommControl <> 0 Then
Load gfrmComms.MSComm(iCurrCommControl)
End If
If gfrmComms.MSComm(iCurrCommControl).PortOpen Then gfrmComms.MSComm(iCurrCommControl).PortOpen = False
gfrmComms.MSComm(iCurrCommControl).CommPort = oLcd.Port
gfrmComms.MSComm(iCurrCommControl).Settings = ("19200,n,8,1")
gfrmComms.MSComm(iCurrCommControl).DTREnable = True
gfrmComms.MSComm(iCurrCommControl).RTSEnable = True
oLcd.ComPortControl = iCurrCommControl
iCurrCommControl = (iCurrCommControl + 1)
End If
Skip_This_Comm:
[COLOR="Magenta"] If Not Err.Number = 0 Then
Err.Clear
MsgBox "Unable to load device " & oLcd.Description & " connected to port " & oLcd.Port & "! due to the following error - " & Err.Description
End If[/COLOR]
Next
End Sub