define_signal
Define a CAN signal with bit-level precision, specifying start bit, length, and conversion parameters to map raw data to physical values.
Instructions
Define a named signal from a CAN message (bit-level precision). Physical value = (raw * scale) + offset.
Args: name: Signal name, e.g. 'engine_rpm' or 'throttle_pct'. can_id: CAN message ID. start_bit: LSB position (little_endian) or MSB position (big_endian), 0-based. length: Signal width in bits. byte_order: 'little_endian' (Intel/LSB-first) or 'big_endian' (Motorola/MSB-first). value_type: 'unsigned' or 'signed'. scale: Multiplier for raw→physical conversion. offset: Addend for raw→physical conversion. unit: Physical unit string, e.g. 'rpm', 'km/h', '%', '°C'. description: Human-readable description.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| can_id | Yes | ||
| start_bit | Yes | ||
| length | Yes | ||
| byte_order | No | little_endian | |
| value_type | No | unsigned | |
| scale | No | ||
| offset | No | ||
| unit | No | ||
| description | No |