Custom Protocols
When configuring devices, you may have noticed that they can log data from ECU streams, provided the communication protocol is supported. A protocol is a description of how all ECU channels are encoded in the stream.
AiM provides a comprehensive set of protocols, but if they do not fit your needs, you can define your own: these are called custom protocols.
The Custom Protocols Manager is a database window, vertically divided into two parts:
Right (List): Shows all custom protocols by default, including most important details and buttons for main operations.
Left (Filtering): Allows filtering to display a subset of protocols. Options include: All Custom Protocols, Manufacturers, and Manual Collections.
All Custom Protocols
Select this item in the left column to view the full list of custom protocols you have created or imported.
At first use, this list will be empty. Click New to create a custom protocol from scratch, or Import to load one from a drive.
Custom Protocols of Specific Manufacturers
If you create or import custom protocols for multiple manufacturers, the left column will display one row for each manufacturer.
Selecting a manufacturer filters the list to show only the protocols associated with it.
Custom Protocols in Manual Collections
You can manually group custom protocols into collections. After creating a collection, selecting it displays only the protocols you placed in it.
List of Custom Protocols
The toolbar above the list of custom protocols allows the following operations:
New / Delete - Create or remove a custom protocol.
Import / Export - Import a custom protocol from an external drive, or export one to a drive.
Authorizations - Manage passwords that protect your intellectual property.
Creating a Custom CAN Protocol
Use the sender’s CAN specification to define a protocol. You need its CAN bus speed, CAN IDs, byte order, signal positions and lengths, data formats, units and conversions. If an ID carries different message layouts, you also need the row counter that identifies each layout. The example below uses one layout without a row counter.
Custom CAN Protocol Example: One Pressure Measure
This is an illustrative CAN definition, not a protocol for a particular ECU. Assume that the sender’s specification gives a bus speed of 500 kbit/s and this eight-byte frame:
CAN ID: 0x500
Data: E8 03 00 00 00 00 00 00
The first two bytes contain an unsigned 16-bit oil pressure value, least significant byte first. Each count represents 0.01 bar, with no offset. The remaining bytes are unused in this example.
Click CAN Protocols in the main toolbar to open the Custom Protocols manager, then click New Protocol. The New Protocol dialog opens.
Select the manufacturer from the list. For this example, click Add Manufacturer, enter
MANUAL_DEMOunder Current Manufacturer, click Add Current Item, and confirm. Select that manufacturer if it is not already selected.Enter
DEMO_CANunder Edit New Model Name. Choose ECU as CAN Device Type and the 500 kbit/s entry as CAN Bus Speed. Confirm to open the protocol editor.Click Add New CAN Stream. In CAN Stream Settings, enter
0x500as CAN ID, choose Low to High (Little Endian or Intel) under Stream Byte Order, and leave Enable Row Counter unchecked. Confirm.RS3 opens CAN Measure Settings for the first measure. Choose Function first, then set the remaining fields below.
Example measure settings Field
Value
Name
OilPdemoShort Name
PdemFunction
Oil Pressure
Start Bit
0Number of Bits
16Data Format
Unsigned integer
Gain
0.01Offset
0Unit After Conversion
bar
Default Channel Unit
bar
Use the Gain / Offset conversion rather than Encoding for this numeric measure. Leave Stepped Values, As Bit Fields and Protected by Key unchecked for the example. Review Max. Frequency and Default Channel Frequency for your actual sender and recording requirements; the frame example does not specify a recording rate.
Check the bit diagram: the measure occupies the first two bytes, starting at bit 0. In this editor Start Bit identifies the least significant bit of the measure. Confirm the measure settings.
Click Save in the protocol editor. The protocol is added to the manager under the chosen manufacturer and model.
For the illustrated frame, 0x03E8 is 1000 counts. With the specified
conversion, 1000 * 0.01 + 0 gives 10 bar.
To add another CAN ID, use Add New CAN Stream again. To add a measure to an existing stream, double-click unused bits in that stream’s row. Double-click an existing measure’s bits to reopen its settings. Keep each signal’s bit position, byte order and conversion consistent with the sender’s specification.
Using and Checking a Custom CAN Protocol
Open the intended device configuration and its ECU Stream tab.
Select the saved custom manufacturer and model. For the example, select
MANUAL_DEMOandDEMO_CAN. Review the enabled channels, units and recording frequencies. Protocol availability depends on the device and the selected CAN device type.Follow Saving and Transmitting a Configuration. Saving a protocol in the library does not transmit it to a device.
If you have a captured CAN stream, follow Applying a Protocol in Sniffed Data Analysis to check the CAN ID, byte order and bit extraction. Sniffed Data Analysis shows raw decoded values with Gain 1 and Offset 0. The example bytes therefore show 1000 there; 10 bar is the expected result after the protocol conversion is applied in the device configuration. Check converted values separately against the sender’s known values.
Custom Protocol Editing and Problems
Open a protocol from the manager to edit its streams and measures, then click Save. To change its manufacturer, model, CAN device type or bus speed, close its editor and use Edit Protocol from the manager.
A password is requested when opening a protocol: obtain the protocol’s password from its author. Set Protocol Password protects editing; measure protection keys are separate and are not needed for the example.
The measure cannot be confirmed: check that its name and short name are filled in, along with start bit, bit length, Gain and Offset. Review the selected bit range in the diagram.
A value is plausible but incorrect: first check CAN ID, row counter, byte order, bit position, bit length and signed/unsigned format. Then check Gain, Offset and Unit After Conversion against the specification.
Search leaves other streams visible: in the protocol editor, search highlights matching channel names and short names in yellow. It does not filter the stream list or search CAN IDs.