Diagnosis in the Application
ECU State
The ECU state of a device can be interrogated in the application in three different ways:
<name in device tree>.State
property (IoDrvJ1939
library)<name in device tree>.GetDeviceState
method (CAA Device Diagnosis
library)The method does not return a specific J1939 state, but the information whether the device is running or not. A mapping table between
ECUSTATE
andDEVICE_STATE
is found in the library documentation ofIoDrvJ1939
.
For remote ECU:
Because the J1939 protocol does not define a monitoring mechanism, an ECU failure is not displayed by default. However, you can select Enable communication watchdog in the J1939 ECU configurator and set an appropriate Watchdog time. If no parameter group (has to be defined in the configurator) of the device is received during this time, then the ECU is considered as non-existent and this is indicated accordingly by means of the state property. For this, however, a parameter group has to be defined in the configurator. In the manual of the device, you can read about in which interval the device sends parameter groups to set the correct time. Example: If an ECU sends a PG in the 1s interval, then the Watchdog time can be set to > 1s.
Diagnostic Messages DM1 and DM2
For DM1 and DM2 messages, function blocks for receiving (in the case of remote ECUs) and also for sending (in the case of local ECUs) are available in the IoDrvJ1939
library.
DM1_Read
DM2_Read
DM1_Write
DM2_Write
Watching an Individual Parameter Group
Because the global communication watchdog monitors all parameter groups of a device, the failure of an individual parameter group might not be detected. In these cases, it makes sense to watch individual parameter groups. With the function block ReceiveWatchdog
, you can check whether or not the parameter groups are received regularly. The function block requires an instance of the function block ReceiveParameterGroup
as an input to which the respective PGN to be watched is communicated.
The outputs of the function block ReceiveWatchdog
show whether or not the parameter group has been received in the current cycle and whether or not a timeout exists.
