Hi,
Is it possible to call the global reset from the J1939 DTC Monitor on a VBS Macro and if so how would you go about that? Or is there another way of resetting active DTCs in a macro?
Thank you!
Requesting Global Reset in Macro
Re: Requesting Global Reset in Macro
Hi,
unfortunately, DTC monitor functions cannot be accessed from a VBS macro.
But doing a global reset of active DTCs is just sending a global RQST (PGN 59904) for DM11 (PGN 65235), the same does the DTC monitor. When you send the command from the DTC monitor, you can see the generated message in the Receive List of PCAN-Explorer (if the configured filter does not prevent that).
Here is a VBS macro example that creates the correct message in the Transmit List for the first connection in the project (assuming it is a J1939 connection) and sends it once:
unfortunately, DTC monitor functions cannot be accessed from a VBS macro.
But doing a global reset of active DTCs is just sending a global RQST (PGN 59904) for DM11 (PGN 65235), the same does the DTC monitor. When you send the command from the DTC monitor, you can see the generated message in the Receive List of PCAN-Explorer (if the configured filter does not prevent that).
Here is a VBS macro example that creates the correct message in the Transmit List for the first connection in the project (assuming it is a J1939 connection) and sends it once:
Code: Select all
Sub J1939_GlobalResetActiveDTCs()
Dim id, msgs, msg
id = &H18EAFF00 + Connections(1).CommunicationObject.PreferredAddress
Set msgs = TransmitMessages.FindID(id)
If (msgs.Count > 0) Then
Set msg = msgs(1)
Else
' Transmit message not configured yet, create a new one
Set msg = TransmitMessages.Add
With msg
.BeginUpdate
.Connection = Connections(1)
.ID = id
.DataLength = 3
.Data(0) = &HD3
.Data(1) = &HFE ' FED3h is PGN 65235
.EndUpdate
End With
End If
msg.Write 0
End Sub
Re: Requesting Global Reset in Macro
Hi,
One more question, am supposed to be able to see the DTCs not active in the monitor? What I mean by that is when I send through this macro should I see the DTCs in the Active DTCs of the J1939 Monitor disappear, because that's what it does when you global reset, as well as the DTC Count of each Source going to zero.
Thank you!
One more question, am supposed to be able to see the DTCs not active in the monitor? What I mean by that is when I send through this macro should I see the DTCs in the Active DTCs of the J1939 Monitor disappear, because that's what it does when you global reset, as well as the DTC Count of each Source going to zero.
Thank you!
Re: Requesting Global Reset in Macro
The DTCs and counters listed in the J1939 DTC Monitor are only cleared if the command to clear/reset DTCs is sent from the DTC monitor.