Ecu Task#

class pycanape.ecu_task.EcuTask(dll: CANapeDll, asap3_handle: LP_tAsap3Hdl, module_handle: c_ushort, task_info: TTaskInfo2)[source]#

The EcuTask class is not meant to be instantiated by the user. EcuTask instances are returned by get_ecu_tasks().

Parameters:
daq_check_overrun(reset_overrun: bool = False) None[source]#

Check if data have been lost due to FIFO overrun.

Asap3CheckOverrun doesn’t have any impact to the FIFO data. All data are available excluding the data record which caused the overrun.

Parameters:

reset_overrun (bool) – If True reset the overrun flag in CANape

Return type:

None

daq_get_current_values(channel_count: int) List[Sample][source]#
Parameters:

channel_count (int) –

Return type:

List[Sample]

daq_get_fifo_level() int[source]#

Get number of samples in FIFO.

Return type:

int

daq_get_next_sample(channel_count: int) List[Sample][source]#
Parameters:

channel_count (int) –

Return type:

List[Sample]

daq_setup_channel(measurement_object_name: str, polling_rate: int, save_to_file: bool) None[source]#

Add a measurement object to the data acquisition channel list.

Parameters:
  • measurement_object_name (str) – Name of object to measure

  • polling_rate (int) – If accquisition mode is polling this specifies the polling rate. Reduce the original sample rate of ECU data. Example: If the sample rate of the ECU is 1 per 10msec, but the CANapeAPI client is set to receive data only every 50msec, the option ‘downsampling’ must be set to 5.

  • save_to_file (bool) – Save this channel to measurement file. Therefore the currently selected Recorder will be used

Return type:

None

property description: str#

Description text

property event_channel: int#
property task_cycle: int#

Cycle rate in msec.

0 if not a cyclic task or unknown. In case of modes polling or cycle this parameter has no sense.

property task_id: int#

Identification number.

The task Id is dynamically generated by CANape depending on internal definitions.

class pycanape.ecu_task.Sample(timestamp, value)[source]#

Create new instance of Sample(timestamp, value)

Parameters:
timestamp: float#

Alias for field number 0

value: float#

Alias for field number 1