Project

General

Profile

Actions

CAN Bus Output » History » Revision 1

Revision 1/2 | Next »
Adam Klama, 06/21/2026 03:29 PM


CAN Bus Output

Overview

A CAN Bus Output packs a single CANbus signal into a raw outgoing CAN
frame, using a byte/bit layout you define by hand. Use it when you know the frame
layout (e.g. from a DBC) for an arbitrary or custom device and there is no
CAN Preset for it.

This is the raw frame signal approach: you give the message ID, say how the
bits are encoded and where they sit, then scale your source value into the raw
signal. To write a named object on a supported device instead, use a
CAN Object Output.

Prerequisites & hardware

  • A defined CAN bus for the channel the frame is sent on — see
    Working with the CAN Bus.
  • The frame's message ID and bit layout for the signal you want to write
    (length, offset, encoding).
  • A source value (a map, driver or input) to drive the signal.

Add it in the app

  1. Add a new output and choose CAN Bus Output as the type.
  2. Give it a clear alias (e.g. Requested Torque).
  3. Enter the Message ID and its ID type, then the encoding type,
    length and offset that place the signal in the frame.
  4. Set the in → raw scaling and a default value, then drive it from a
    map/driver.

Settings reference

Schema: config/CanbusOutputConfiguration.proto.

Setting Meaning Unit Range / values Notes
Message ID CAN frame identifier to send hex fixed32 The arbitration ID of the outgoing frame.
Message ID type Identifier width Extended (29-bit), Standard (11-bit) Must match what the receiving device expects.
Encoding type How the value is packed into the bits UnsignedBigEndian, UnsignedLittleEndian, SignedBigEndian, SignedLittleEndian, BitField, CounterField, BitCounterField Selects signedness/endianness/bitfield. CounterField / BitCounterField auto-generate a rolling message counter.
Length Signal length bytes / bits uint32 In bytes for the integer types and CounterField; in bits for the bitfield types (BitField, BitCounterField).
Offset Position of the signal in the frame bytes / bits uint32 Same units as Length: bytes for integer/CounterField types, bits for bitfield types.
In min / In max Input (engineering) range to scale from source unit sint32 The source low/high points.
Raw min / Raw max Raw signal range to scale to sint32 The packed value at In min / In max.
Default value Value packed before a source value is available source unit sint32 Sent until the source provides a value.

Scaling: the source value is mapped from In min…In max to Raw min…Raw max
using two-point interpolation.

Rolling counter: choose CounterField or BitCounterField for keep-alive /
rolling-counter bytes — the controller increments the value each frame for you, so
no source is needed.

Common settings

CAN Bus Output also uses the shared settings — alias and pin. See Common IO Settings.

Example — requested torque to an inverter

  1. Type CAN Bus Output, alias Requested Torque.
  2. Message ID 0x100, ID type Standard (11-bit).
  3. Encoding type UnsignedLittleEndian, Length 2 (bytes), Offset 1
    (starts at byte 1) — a 16-bit value. (A bitfield type would use bits here.)
  4. In min/max 0/500 (Nm) → Raw min/max 0/5000 (0.1 Nm/bit).
  5. Default value 0 so no torque is requested until the strategy drives it.
  6. Add a second output on the same ID with Encoding type CounterField for the
    inverter's rolling-counter byte.

Troubleshooting

  • Receiver ignores the frame: check the Message ID and ID type, and the
    CAN bus baud rate.
  • Value lands wrong / sign flipped: check the encoding type, Length and
    Offset — they are in bytes for integer/CounterField types and bits
    for bitfield types.
  • Receiver reports a counter/checksum fault: add a CounterField /
    BitCounterField output for the rolling-counter byte.
  • Sends an unexpected value at start-up: set a sensible Default value.

Related

Updated by Adam Klama 1 day ago · 2 revisions