Let’s take a quick look at the CAN gateway database file that we’ve provided for you for this example.
There are two CAN messages defined, Ecu1 and Ecu2. In each of these messages there’s several signals. What we’re going to do is, when channel 1 sees a message coming from Ecu1, we’re going to extract some signals in Ecu1, take those values and attach them to a CanMessage of Ecu2 and send it on CAN channel 2.
Let’s jump into TRX and I’ll show you how it works. Here’s our existing CAN gateway t script. Let’s begin by adding a CAN database file to our project by right clicking our project to the right, adding a database, select the database that we’ve provided for you, and you can see that it’s been added to our project. And we can reference the Ecu’s or any of the messages by referring to them as CanMessage underscore message name (CanMessage_ECU2). So we’re gonna go ahead and create a variable for Ecu2, we’re gonna call it Ecu2, lowercase ecu2.