OnMessageReceived
Posted: Tue 13. Jan 2015, 10:26
Hello,
I'm trying to use the "OnMessageReceived" event with J1939 symbols, but this don't work.
My program:
Can some one help me ?
Thanks,
Jean-Félix
I'm trying to use the "OnMessageReceived" event with J1939 symbols, but this don't work.
My program:
Code: Select all
Sub J1939Node_OnMessageReceived(node, count)
Dim RcvMsg
Set RcvMsg = CreateObject("J1939Pcan.PCANJ1939RcvMsg")
If node.Read(RcvMsg)Then
PrintToOutputWindow RcvMsg.Timestamp & ">" & count & " ID: " & RcvMsg.ID & " PGN: " & RcvMsg.PGN
If RcvMsg.PGN = 65304 Then
Dim dow, dt, mth, ye, h, mn ,s
Set dow = Signals("DayOfWeek")
Set dt = Signals("Date")
Set mth = Signals("Month")
Set ye = Signals("Year")
Set h = Signals("Hour")
Set mn = Signals("Min")
Set s = Signals("Sec")
PrintToOutputWindow dow.Value & " " & dt.Value & "/" & mth.value & "/" & ye.value & " " & h.value & ":" & mn.value & ":" & s.value
End If
Else
PrintToOutputWindow "last error: " & node.LastError
End If
End Sub
Thanks,
Jean-Félix