Requesting Global Reset in Macro

Professional Windows® software to communicate with CAN and CAN FD busses and its add-ins: Plotter, CANdb Import, Instruments Panel, and J1939
Post Reply
nimevan4
Posts: 6
Joined: Tue 13. Jun 2023, 20:17

Requesting Global Reset in Macro

Post by nimevan4 » Thu 20. Jul 2023, 22:33

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!

K.Wolf
Software Development
Software Development
Posts: 141
Joined: Wed 22. Sep 2010, 15:37

Re: Requesting Global Reset in Macro

Post by K.Wolf » Fri 21. Jul 2023, 12:44

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:

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

nimevan4
Posts: 6
Joined: Tue 13. Jun 2023, 20:17

Re: Requesting Global Reset in Macro

Post by nimevan4 » Fri 21. Jul 2023, 15:49

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!

K.Wolf
Software Development
Software Development
Posts: 141
Joined: Wed 22. Sep 2010, 15:37

Re: Requesting Global Reset in Macro

Post by K.Wolf » Mon 24. Jul 2023, 14:02

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.

Post Reply