Customized CAN mirror (CAN1 -> CAN2)

General Q&A specific to RaceCapture/Pro. For app related questions post in the RaceCapture App forum. also see the <a href="http://www.autosportlabs.net/RaceCapture">RaceCapture Information Page</a>

Moderators: JeffC, rdoherty, stieg, brentp

Post Reply
thoraxe
Posts: 47
Joined: Wed Dec 14, 2016 2:29 am
Location: Atlanta, GA
Contact:

Customized CAN mirror (CAN1 -> CAN2)

Post 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&#40;&#41;
  readECUCanStuff&#40;&#41;
  writeECUCanStuff&#40;&#41;
end
Right?

brentp
Site Admin
Posts: 6274
Joined: Wed Jan 24, 2007 6:36 am

Post 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!
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

thoraxe
Posts: 47
Joined: Wed Dec 14, 2016 2:29 am
Location: Atlanta, GA
Contact:

Post 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&#40;30&#41;
function onTick&#40;&#41;
  txCAN&#40;1, 864, 0, &#123;00,00&#125;&#41;
end
I would only be sending this message 30 times per second?

brentp
Site Admin
Posts: 6274
Joined: Wed Jan 24, 2007 6:36 am

Post 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!
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

Post Reply