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:
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.
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.
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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:
itfParameterGroup
along with an eError ofWRONG_PARAMETER
and no clue how that isn't working.ReceiveParameterGroup is for "building" the needed data structure. You should pipe itfParameterGroup into ReceiveWatchdog: https://help.codesys.com/webapp/8LVZD-HU9xCDZg4RnKWx5CheJCc%2FReceiveWatchdog;product=IoDrvJ1939;version=3.5.14.0
Ah, I was some what close! I saw ReceiveWatchdog and thought it was only at the ECU leve. Gotta try this!
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.
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).
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