OPC and VB6 MSCOMM COM port

Here is a quick fix that I use and works very well.

Use it like this:
'
' Close Com Port
'
Port_Open_Or_Close [ComControl],False
'
' Assign Settings
'
comControl.Port = [Whatever]
comControl.Settings = "Whatever"
'
' Open Com Port
'
Port_Open_Or_Close [ComControl],True


Sub Port_Open_Or_Close(ByRef oCommControl As MSComm, ByVal bOpen As Boolean)
On Error Resume Next

oCommControl.PortOpen = False

If Err.Number <> 0 Then Err.Clear

If bOpen Then oCommControl.PortOpen = True

If Err.Number <> 0 Then Err.Clear

End Sub
 

Similar Topics

G'day there, I want to send real time data to a VB6 application. It works in excel thanks to a previous response from member - plastic, but I...
Replies
0
Views
3,807
Hello I've been using RSLinx OPC Server to read/write tag values to/from a VB6 program, but we've been wanting to move to the...
Replies
4
Views
6,886
I am running CCW 13 trying to upload to a micro 820 vers.12 I get an output message OPC server is unable to load project controller. Please help!
Replies
5
Views
255
I know nothing about simaticnet OPC server. I do know Kepware. I would only ever scale raw to engineering in the PLC, but it is possible to scale...
Replies
5
Views
223
If anyone has a crack for IBH OPC Server, please send it to: [email protected] Urgently. Thanks in advance!
Replies
1
Views
134
Back
Top Bottom