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 CAN, Manufacturers, and Manual Collections.
All Custom CAN
Select All Custom CAN 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 Protocol 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 Protocol / Clone - Create a protocol or copy a selected one before making changes.
Delete - Move selected protocols to Trash.
Import / Export - Import an AiM protocol or a DBC file, or export a protocol to a drive.
Merge - Create a protocol from existing protocols.
Authorizations - Manage passwords that protect your intellectual property.
Importing and Checking a Protocol
Keep the original file and the sender’s specification available. An imported file still needs to be checked against the equipment that sends the CAN data.
Click Import. Choose AiM Protocol File for an AiM protocol, or DBC Protocol File for a CAN database file with the
.dbcextension.Select the file or files. With one DBC file, confirm the manufacturer, model, bus speed and Silent setting in the protocol settings dialog. With several files, Importing DBC files lets you prepare the Manufacturer and Model for each file. Each model name must be unique across the entire protocol library and among the files being imported. To set or change bus speed or Silent during import, import one DBC file at a time. Match the bus speed to the sender and choose Silent according to the installation’s CAN requirements; do not assume that the initially proposed settings are correct.
Confirm the import and read any errors. If you import several files, check which ones succeeded before trying again.
When RS3 opens the DBC channel validation window, compare Name in DBC and Unit in DBC with the assigned Name, Short Name, Function, Max Freq., Default Freq. and Default Unit. Use DBC Info when the original signal definition needs checking. Mark Validate only after checking that channel, then confirm the window to save the validation changes.
Open each imported protocol and check its bus speed and Silent setting, CAN IDs, byte order, signal positions, data formats and conversions against the sender’s specification. This check also applies after a multi-file import. Test known values, as in the pressure example below, before using it for logging or alarms.
Cancelling the channel validation window does not undo the file import. Check the protocol list before importing the same file again. Validation records your review of the channel settings; it does not prove that a connected sender is transmitting the expected data.
Do not assume that an error has undone the import: it can leave a protocol in the list with only part of the DBC data, or no measures at all. A green DBC indicator does not prove that the original file was imported completely. Before using the protocol, compare the imported frame and measure counts, CAN IDs, definitions and units with the original DBC file.
Illustrative pressure measure imported from a DBC file, after Function has been assigned to Oil Pressure. The bit diagram and Info from DBC file help compare the imported definition with the conversion settings.
Merging Existing Protocols
Use Merge when several devices on one CAN bus need a combined protocol. The devices must use compatible CAN settings, and their protocols must not define the same CAN frame ID. Merging combines definitions; it cannot resolve two senders transmitting different data with the same ID.
Select the protocols to combine and click Merge. Read the notice before continuing.
In Merge Existing CAN Protocols, check Selected Protocols. Use Add Protocol to add a missing one, or remove a protocol from this list if it should not be included.
Enter a new Manufacturer Name and Model Name for the result. Choose CAN Bus Speed to match the physical bus, then confirm.
If RS3 reports incompatible settings or a shared CAN frame ID, stop and check the source protocols and the equipment specifications. Change the sender’s setup only where its documentation permits it, then update the matching protocol and retry. Do not change an ID in the protocol alone: the sender would still transmit its original ID.
After Merged Protocol Created, open the result and check its channels before selecting it in a device configuration. Keep the original protocols so that you can compare definitions or repeat the merge.
Deleting, Restoring and Erasing Protocols
Close the protocol’s editor before deleting it. In All Custom CAN, select the protocol, click Delete and confirm. It moves to Trash in the left column.
To recover it, select Trash, select the protocol and click Restore. Check that it is listed again under All Custom CAN. To remove a trashed protocol permanently, select it in Trash, click Erase and read the confirmation carefully. An erased protocol cannot be restored from Trash; keep an exported copy if you may need it again.
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.