|
I wrote this class back in the day.. Basically, once you create mscomm1 and timer1 you'll never need to touch those controls. When you use
dim withevents elm as clselm323
then you should see "elm" as a control in the code window with its own events. Those events fire whenever things happen with that class. So you don't have to handle mscomm1_oncomm at all.
Let's say that your elm323 is on com2.
strReturn$ = elm.openELM(mscomm1, 2, timer1)
if strReturn$ = "" then
msgbox "opened successfully"
else
msgbox "open error: " & strReturn$
end if
private sub elm_statusmessage(byval strMessage as string)
debug.print strMessage
end sub
private sub elm_OBDReturn(ByVal bMode As Byte, ByVal bPID As Byte, ByVal strData As String, ByVal lngData As Long)
msgbox "OBD Returned mode " & cstr(cint(bMode)) & ", pid " & cstr(cint(bPID)) & ": " & cstr(lngdata)
end sub
|