Skip to main content Link Menu Expand (external link) Document Search Copy Copied

[canbusinputs]

This section enables some basic value selection from canbus messages that may have come from other systems. The capabilities are fairly limited at the moment but will be expanded in due course, once there is clearer information about the sorts of things that may be required.

Canbus inputs are specified in the following way:

[canbusinputs]
<attribute name>=<id>,<offset>,<length>,<datatype>,<delta>,<divideby>,<numdigits>,<decimal places>,<log file column name>,<units>

<attribute name> can be either a new attribute name or an existing attribute name. If you use an existing attribute then the value received will be written to that attribute. There are situations where this is a good idea (populating VSS for example) but there are also situations where it is not a good idea, such as when the attribute you have chosen is also being populated by some other data source (e.g. the speeduino ECU data). In that scenario the value your custom input generates will keep being overwritten by the other data source.

<id> Is the canbus message Id you want to capture. This is a decimal number. Note that canbus IDs are often specified in Hexadecimal so be sure to make the conversion first if necessary.

<offset> Is the offset, where zero is the first byte and 7 is the last byte, of the 8 byte canbus message where the data you want starts.

<length> Is the number of bytes the data item you want consists of.

<datatype> Is the datatype of the item. Possible values are: 0=byte, 1=Word (16 bit unsigned), 3=Signed Word (16 bit signed), 4=LongWord (32 bit unsigned), 5=Big Endian Word (32 bit), 6=Big Endian Longword (32 bit)

<delta> Integer. Is usually zero but specifies any delta that should be applied to the value when displaying it. The delta is added, so to perform a subtraction make this a negative number.

<divideby> Integer. Specify zero for no division. Otherwise specifies that the value should be divided by this value before being displayed.

<numdigits> Specifies the number of whole number digits that should be displayed. The value will be left padded with zero’s if needed.

<decimal places> Specifies the number of decimal places to display the value to. Use zero for none.

<log file column name> String that should go at the top of the log file.

<units> Units to go in the log file.

There must be no spaces between the commas. There can be spaces in the text fields. Note that with <delta> and <divideby>, any division is performed first, then the delta is applied.

Example:

[canbusinputs]
oilpressure=1231,0,1,0,0,0,0,0,Oil Pressure,PSI
custom=1600,0,1,0,0,10,3,2,Custom Field,wpm
custom2=1600,1,1,0,0,10,3,2,Custom Field 2,secs

The first example populates an existing speeduino attribute using canbus id 1231 decimal. It selects the first byte (offset=0, length=1, datatype=0) and will simply display the number as received. As this is a byte quantity the possible range of numbers is 0 to 255.

The second example creates a custom attribute called ‘custom’. You can add this attribute to any gauge and add it to the datalog if required. Note that adding to the datalog is not automatic; you must extend the Datalog Settings to add it. This second field is also in byte zero but this time from message id 1600. It has a ‘divideby’ of 10 and a delta of zero, with 3 digits specified and 2 decimal places. So if the value 127 were received in byte 0 of message id 1600, the value you would see on screen would be ‘012.7’.

The third example creates another new custom attribute called ‘custom2’. It comes from the same message as the previous custom attribute, only this time it uses byte 1 (the second byte in the message) instead of byte zero.