Module#

class pycanape.module.Module(dll: CANapeDll, asap3_handle: LP_tAsap3Hdl, module_handle: c_ushort)[source]#

The Module class is not meant to be instantiated by the user. Instead, Module instances are returned by create_module(), get_module_by_index() and get_module_by_name().

Parameters:
execute_script_ex(script_file: bool, script: str) Script[source]#

Execute a script file or a single script command.

Parameters:
  • script_file (bool) – Declares interpretation of parameter script. If ‘script_file’ is true, parameter ‘script’ is interpreted as the file name of the script file to be executed. If ‘script_file’ is false, ‘script’ is interpreted as a single script command

  • script (str) – A script filename or a single script command

Returns:

The instance of the Script class

Return type:

Script

get_calibration_object(name: str) ScalarCalibrationObject | AxisCalibrationObject | CurveCalibrationObject | MapCalibrationObject | AsciiCalibrationObject | ValueBlockCalibrationObject[source]#

Get calibration object by name or wildcard pattern (e.g. ‘*InitReset’).

Parameters:

name (str) –

Return type:

ScalarCalibrationObject | AxisCalibrationObject | CurveCalibrationObject | MapCalibrationObject | AsciiCalibrationObject | ValueBlockCalibrationObject

get_communication_type() str[source]#

Get current communication type (e.g. “CAN”).

Return type:

str

get_database_info() DatabaseInfo[source]#

Get Info concerning the database file.

Return type:

DatabaseInfo

get_database_objects() List[str][source]#

Get a list of all object names in database.

Returns:

List of object names

Return type:

List[str]

get_database_path() str[source]#

Get path to database file.

Return type:

str

get_ecu_driver_type() DriverType[source]#

Retrieves the drivertype of an ECU.

Returns:

DriverType enum

Return type:

DriverType

get_ecu_tasks() Dict[str, EcuTask][source]#

Get available data acquisition tasks.

Returns:

A dictionary with the ecu task description as keys and the EcuTask instances as values

Return type:

Dict[str, EcuTask]

get_measurement_list_entries() Dict[str, MeasurementListEntry][source]#

Retrieve the entries from the CANape Measurement list.

Returns:

A dict of Measurement list entries that uses the object name of the entries as key

Return type:

Dict[str, MeasurementListEntry]

get_module_name() str[source]#

Get name of module.

Return type:

str

get_network_name() str[source]#

Receives the name of the used network.

Return type:

str

has_resume_mode() bool[source]#

Information about the Resume mode.

Returns:

Function returns True if the device supports resume mode.

Return type:

bool

is_ecu_online() bool[source]#

Asks CANape whether a ECU is online or offline

Return type:

bool

is_module_active() bool[source]#

Return the activation state of the module.

Returns:

activation state

Return type:

bool

module_activation(activate: bool = True) None[source]#

Switches the module activation state.

Parameters:

activate (bool) – True -> activate Module False -> deactivate Module

Return type:

None

release_module() None[source]#
Return type:

None

reset_data_acquisition_channels_by_module() None[source]#

Clears the data acquisition channel list of a specific module.

Note

this function only clears these measurement objects from the API-Measurement-List which are defined by API

Return type:

None

switch_ecu_on_offline(online: bool, download: bool = True) None[source]#

Switches an ECU from online to offline and vice versa.

Parameters:
  • online (bool) – Switch ECU online if True, switch ECU offline if False

  • download (bool) – if this parameter is set to true CANape will execute an download in case of online = True

Return type:

None

class pycanape.module.MeasurementListEntry(task_id, rate, save_flag, disabled, object_name)[source]#

Create new instance of MeasurementListEntry(task_id, rate, save_flag, disabled, object_name)

Parameters:
  • task_id (int) –

  • rate (int) –

  • save_flag (bool) –

  • disabled (bool) –

  • object_name (str) –

disabled: bool#

Alias for field number 3

object_name: str#

Alias for field number 4

rate: int#

Alias for field number 1

save_flag: bool#

Alias for field number 2

task_id: int#

Alias for field number 0

class pycanape.module.DatabaseInfo(file_name, file_path, file_type)[source]#

Create new instance of DatabaseInfo(file_name, file_path, file_type)

Parameters:
file_name: str#

Alias for field number 0

file_path: str#

Alias for field number 1

file_type: DBFileType#

Alias for field number 2