J1939 PGN Receive Timeout/Watchdog

mr337
2020-06-18
3 days ago
  • mr337

    mr337 - 2020-06-18

    Hi All,

    I am looking into getting the last received timeout for a specific PGN. I am interfacing with a few actuators that use the same address ECU address 0, but different reporting PGN to separate the actuators. In addition the PGN does not have a heartbeat bit or byte of anykind. This is not ideal but outside our ability to change.

    In Codesys we build out an Actuator remote ECU and all actuators report back to the ECU, just under different PGNs. The issue is using the ECU watchdog will only check for a single message received. Since we have several actuators all but a single actuator could be disconnected and the watchdog won't trigger.

    So what I am trying to do is get the last received time for a particular PGN. Few things I have tried:

    1. Modifying the mapped PGN values to some value to mark it as dirty. New messages will reset the message knowing we received a proper message. Unfortunately the mapped values are read only.
    2. Use the J1939.ReceiveParameterGroup on a 1s timer to see if a PGN has been received. I can't seem to get anything out of the FB itfParameterGroup along with an eError of WRONG_PARAMETER and no clue how that isn't working.
     
  • mr337

    mr337 - 2020-06-18

    Ah, I was some what close! I saw ReceiveWatchdog and thought it was only at the ECU leve. Gotta try this!

     
  • mr337

    mr337 - 2020-06-21

    Wanted to add that worked perfectly. An interesting thing is the ReceiveWatchdog has an xEnabled param while the ReceiveParameterGroup need a rising edge signal. I think as a general rule the rising edge frequency needs to be faster than the timeout on the ReceiveWatchdog.

     
  • sgronchi

    sgronchi - 2020-06-22

    Well, you need to build the ParameterGroup only once, so you can just call it the first cycle with xExecute = FALSE and from the second one with xExecute = TRUE, and connect ReceiveWatchdog.xEnable to ReceiveParameterGroup.xDone (if you want to be sure, interpose a latch between them).

     
  • kohanrs

    kohanrs - 3 days ago

    Hello, Does anyone know the reason ReceiveParameterGroup Error flag get set if a Proprietary-A Peer-to-Peer PGN (0xEF00) is passed to it? It works fine with Proprietary-B PGNs ( 0xFFC2). Thank You

     

Log in to post a comment.