Page 1 of 1

Customized CAN mirror (CAN1 -> CAN2)

Posted: Tue Dec 20, 2016 3:50 am
by thoraxe
I have an RCP that's going to be hooked into a system with a Haltech ECU, Haltech WBO2 and AiM dashboard. Unfortunately, the dashboard is an older MXL unit which has a "locked" firmware with fixed expectations for Haltech CAN messages (among other shortcomings).

Since I am only using the dashboard for display, and some of the field names can be customized, I am contemplating feeding the dashboard from RCP CAN2 and having the RCP log everything coming into CAN1. For any signal that needs to be "modified" to be displayed on the dashboard (for example, rolling several statuses off the Haltech and other vehicle conditions into a general MIL/CEL)

Judging from the Lua Scripting Guide it appears that you can both read and transmit on either CAN channel independently. So, I would think that you could do something like the following without a problem:

Code: Select all

function onTick()
  readECUCanStuff()
  writeECUCanStuff()
end
Right?

Posted: Tue Dec 20, 2016 5:15 am
by brentp
Yup, that'll totally work. No conflicts on reading and writing to/from the same CAN channel, or bridging one to the other, etc.

Keep us posted on the project!

Posted: Thu Dec 21, 2017 1:19 am
by thoraxe
Bringing up a really old thread:

The LUA scripting area is only capable of a 30Hz onTick. If I was using txCAN() to send mirrored data, it sounds like the best I could do is send it at 30Hz?

In other words:

Code: Select all

setTickRate(30)
function onTick()
  txCAN(1, 864, 0, {00,00})
end
I would only be sending this message 30 times per second?

Posted: Tue Jan 02, 2018 12:47 am
by brentp
Hi, you can actually run the Lua script onTick() at up to 1000Hz; we've recently fixed the documentation. However, this will be limited to how fast the script actually runs - if the script is doing a lot inside the tick handler, it may run slower than the set rate.

Hope this helps!