martin,
If you want to grab the EGTs over CAN, the final EGT value (or the ADC count, if you prefer to do the conversion later in a TunerStudio formula or similar) must be in the GPIO's outpc structure. The outpc structure is where all the OutputChannels are located. All of the output channel values have variable names that start with "outpc.", so they are things like outpc.seconds, outpc.egt1, etc.
For example, you might have this in outpc:
Code: Select all
typedef struct {
unsigned char seconds;
signed int egt1;
singed int egt2;
...
} variables; // end outpc. structure
variables outpc;
The offset is the count (in bytes) that any particular outpc. variable is from the start of the outpc structure. So the first value has offset zero. Suppose the first value is a char (i.e. one byte long). Then the second variable has offset = 1. If it is an int (2 bytes long), then the third variable has offset 3, and so on.
In the INI, this would look like this:
Code: Select all
[OutputChannels]
seconds = scalar, U08, 0, "sec", 1.000, 0.0
egt1 = scalar, S16, 1, "deg", 1.000, 0.0
egt2 = scalar, S16, 3, "deg", 1.000, 0.0
where U08 means unsigned and 8 bits long (8 bits = one byte) and S16 means signed and 16 bits long (2 bytes). 1.000 is the value TS should multiply the raw value by, and 0.0 is the value is should add to all incoming values. We rarely use the add value, but the multiplier is often useful because we cannot pass decimal values, so we often compute a value that is 10 times greater (or 100x) then multiply by 0.1000 (or 0.0100) in TS as appropriate to get fractional values.
Note that although I have used the same names in outpc and the INI, this is not a requirement. They can be very different names, since it is the actual memory locations that are used in passing values back and forth. However, using the same names can make debugging simpler sometimes.
If this was mine, I would first get the INI setup and functioning properly with a direct serial connection to the GPIO board before using the CAN pass-through. It's just easier to troubleshoot that way.
Lance.
"Never wrestle with pigs. You both get dirty and the pig likes it." - George Bernard Shaw