proper way to set default for CAN channels during no CAN

Support forum for users of the M1 Build

proper way to set default for CAN channels during no CAN

Postby cbracer on Wed Jul 27, 2016 4:50 pm

I have a M1 and it needs to receive a modifier for traction control so I setup a channel to receive it over CAN. But when the device sending that message gets reset or restarted, there is no CAN message and the ECU decides to nullify the value. It actually removes the value and reports nothing other than a CAN diag error. How does one set a default for a sensor input that is receiving data over CAN ? I can't increase the timeout beyond 0.5 seconds because that is hard coded into M1 :( attached is a picture of the channel inputs I setup as sensors. Is the type "sensor" correct for this?
Attachments
channel properties.jpg
channel properties.jpg (242.66 KiB) Viewed 7437 times
cbracer
 
Posts: 4
Joined: Tue Oct 14, 2014 10:29 am

Re: proper way to set default for CAN channels during no CAN

Postby MalcolmG on Fri Jul 29, 2016 7:50 am

Personally I wouldn't set it up as a sensor, rather I would use a channel to hold the value and a scheduled function to update the channel. In the function you can then use a conditional to either update the value when you've received a valid message over CAN, or keep the last good value if you have a CAN fault.
MalcolmG
Pro User
 
Posts: 77
Joined: Fri Dec 18, 2015 1:34 pm
Location: Auckland, NZ


Return to M1 Build

Who is online

Users browsing this forum: No registered users and 7 guests