Author Topic: RESET CAN DATA AT RECEIVED END TO 0  (Read 24108 times)

Offline Mike AA

  • PLUS+1 Guru
  • *****
  • Posts: 117
  • Karma: +0/-0
    • Dewind Dewatering
RESET CAN DATA AT RECEIVED END TO 0
« on: September 21, 2020, 10:28:49 PM »
I am using 4 mc050-118 each installed on one of our engine pods watching the engine ECM and setting outputs to the transmissions. I have two dm1200 which watch all the data of the whole machine. Communication goes great and if its disconnected the values stop moving. The problem is all the values stay on the screen rather than resetting to zero. I have my code setup that it reads what position each pod is in and puts the relevant data in the relevant column. I need all the data to go blank if a pod is removed or gets disconnected.

I setup a swich at each can data RX that if it doesn't receive any data for 2 seconds it sets the value to 0.

Is there a better cleaner way to actually reset the can rx module?

Thanks,
Mike

Offline Tor

  • Administrator
  • PLUS+1 Guru
  • *
  • Posts: 296
  • Karma: +28/-1
Re: RESET CAN DATA AT RECEIVED END TO 0
« Reply #1 on: September 22, 2020, 07:33:53 AM »
Hi mikeaa12,

I believe that checking the updated Rx is the most common and easiest way to do the thing you want to achieve.
I guess the values goes to zero after 2 seconds on the display?
The one thing you can do is to lower the 2 seconds to have the values go to zero faster. It's all dependent on how often you send the CAN messages to the display.

Have a nice day
Best regards,
Tor
PLUS+1® SW PAE Team

Offline spittet

  • PLUS+1 Guru
  • *****
  • Posts: 118
  • Karma: +6/-1
Re: RESET CAN DATA AT RECEIVED END TO 0
« Reply #2 on: October 06, 2020, 03:54:36 AM »
I think that it could be a really nice improvement if the CAN RX component could have this function already built-in. This would require the user to set only the following :
- Default value for each byte of the CAN data array
- How much time in ms before applying the default value (0 could mean that this feature is disabled)

Sam

Offline Tor

  • Administrator
  • PLUS+1 Guru
  • *
  • Posts: 296
  • Karma: +28/-1
Re: RESET CAN DATA AT RECEIVED END TO 0
« Reply #3 on: October 06, 2020, 08:19:08 AM »
Hi Spittet,

It kind of already is. The pending signal tells you that the message is not updated.
The problem is what the default value should be. Zero is not always the "safe state", so you need to have different setup for every signal.

It might be easier to create a new block for this. If you already have it, save it and reuse it.
Best regards,
Tor
PLUS+1® SW PAE Team

Offline deaks57

  • PLUS+1 Developer
  • ***
  • Posts: 24
  • Karma: +3/-0
Re: RESET CAN DATA AT RECEIVED END TO 0
« Reply #4 on: October 07, 2020, 02:35:29 AM »
In the Utility FB library there is a CAN Timeout component.

Offline Tor

  • Administrator
  • PLUS+1 Guru
  • *
  • Posts: 296
  • Karma: +28/-1
Re: RESET CAN DATA AT RECEIVED END TO 0
« Reply #5 on: October 07, 2020, 08:03:01 AM »
Thanks deaks57, I did not know that one existed.
Best regards,
Tor
PLUS+1® SW PAE Team

Offline Mike AA

  • PLUS+1 Guru
  • *****
  • Posts: 117
  • Karma: +0/-0
    • Dewind Dewatering
Re: RESET CAN DATA AT RECEIVED END TO 0
« Reply #6 on: October 20, 2020, 04:40:36 PM »
DEAKS57  thanks for sharing! 

It would appear that function does exactly what I would like to do and its clean. I will have to implement this and try it out.