Signals

EnumSignal

class canlib.kvadblib.EnumSignal(db, message, sh, name=None, type=None, byte_order=None, mode=None, size=None, scaling=None, limits=None, unit=None, comment=None, enums=None)[source]

Database signal of type enum, holds meta data about a signal.

Changed in version 1.17: default settings byte_order=SignalByteOrder.INTEL and mode=SignalMultiplexMode.SIGNAL chaged to None.

add_enum_definition(enums)[source]

Add enums dictionary to definition.

property enums

Signal enum definition dictionary

Type

dict

Signal

class canlib.kvadblib.Signal(db, message, sh, name=None, type=None, byte_order=None, mode=None, representation=None, size=None, scaling=None, limits=None, unit=None, comment=None)[source]

Database signal, holds meta data about a signal

add_node(node)[source]

Add receiving node to signal.

attributes()[source]

Return a generator over all signal attributes.

bind(frame=None)[source]

Bind this signal to a frame

Creates a new BoundSignal object representing this signal bound to the given Frame object, or a new Frame object if frame is None..

property byte_order

Get the signal byte order encoding.

Type

SignalByteOrder

property comment

Get the signal comment.

Type

str

data_from(can_data, phys=None, raw=None)[source]

Convert a raw or physical value into CAN data bytes.

delete_attribute(name)[source]

Delete attribute from signal.

get_attribute_value(name)[source]

Return attribute value

If the attribute is not set on the signal, we return the attribute definition default value.

property limits

Get message min and max values

Type

ValueLimits

property mode
property name

Get the signal name.

Type

str

nodes()[source]

Return a generator over all receiving nodes of the signal.

phys_from(can_data)[source]

Return signals physical value from data

property qualified_name

Get the qualified signal name.

Returns database, message and signal names separated by dots.

Type

str

raw_from(can_data)[source]

Return signals raw value from data

remove_node(node)[source]

Remove receiving node from signal.

property scaling

Get the signals factor and offset

Type

ValueScaling

set_attribute_value(name, value)[source]

Set value of attribute ‘name’ on signal.

If no attribute called ‘name’ is set on signal, attach a signal attribute from the database attribute definition first.

property size

Get the signals startbit and length

Type

ValueSize

property type

Get the signal representation type.

Type

SignalType

property unit

Get the signal unit

Type

str

ValueLimits

class canlib.kvadblib.ValueLimits(min, max)
property max

Alias for field number 1

property min

Alias for field number 0

ValueScaling

class canlib.kvadblib.ValueScaling(factor, offset)
property factor

Alias for field number 0

property offset

Alias for field number 1

ValueSize

class canlib.kvadblib.ValueSize(startbit, length)
property length

Alias for field number 1

property startbit

Alias for field number 0