mcDAQListInitialize
- Updated2023-02-21
- 3 minute(s) read
mcDAQListInitialize
Purpose
Defines a DAQ list on a specific DAQ list number and initializes the Measurement task for the specified scaled Measurement channel list.
Format
mcTypeStatus | mcDAQListInitialize(
|
Input
MeasurementNames
Comma-separated list of Measurement names to initialize as a task. You can type in the channel list as a string constant or you can obtain the list from an A2L database file by using the mcGetNames function. Data for those Measurements will be scaled.
ECURefNum
ECURefNum is the task reference which links to the selected ECU. This reference is originally returned from mcECUSelectEx.
DAQListNo DAQListNo specifies which DAQ list entry number should be used for the defined Measurement channel list for the selected ECU. To query the available amount of DAQ List numbers on the ECU use mcPropECU_NumberOfDefinedDAQLists with the function mcGetProperty. To query the defined DAQ list numbers use mcPropECU_DAQListNumbers with mcGetProperty.
DAQMode
DAQMode specifies the I/O mode for the task. For an overview of the I/O modes, refer to the ECU M&C API Basic Programming Model topic.
mcDAQModeDAQList
Data is transmitted automatically by the ECU using DAQ lists. The data can be read back with the mcDAQRead as Single point data using sample rate = 0 or as waveform using a sample rate > 0. Input channel data is received from the DAQ messages.
mcDAQModePolling
In this mode the data from the Measurement task are uploaded from the ECU whenever the mcDAQRead function is called.
DTO_ID
DTO_ID is the CAN identifier for the Data Transmission Object (DTO) used to transmit the data from the DAQ lists to the host. If bit 31 (hex 0x80000000) of the value is set, the value is considered an extended CAN identifier (29-bit). The default value is -1, which means that the DTO ID used to transmit the DAQ list data is the same that is used for the rest of the CCP communication. This is currently supported with CCP protocol and is being ignored with XCP.
SampleRate
SampleRate specifies the timing to use for samples of the Measurement task. The sample rate is specified in Hertz (samples per second). A sample rate of zero means to sample immediately.
For a DAQMode of mcDAQModeDAQList, SampleRate of zero means that mcDAQRead returns a single sample from the most recent messages received, and greater than zero means that mcDAQRead returns samples timed at the specified rate. For DAQMode of mcDAQModePolling, SampleRate is ignored.
Output
DAQRefNum
DAQRefNum is the reference handle for the Measurement task. Use this Measurement task reference in subsequent M&C DAQ functions for this task.
Return Value
The return value indicates the status of the function call as a signed 32-bit integer. Zero means the function executed successfully. A negative value specifies an error, which means the function did not perform the expected behavior. A positive value specifies a warning, which means the function performed as expected, but a condition arose that may require attention.
Use the mcStatusToString function of the ECU M&C API to obtain a descriptive string for the return value.
Description
If an ECU offers a reduced and specific range of DAQ list entry numbers use the mcDAQListInitialize function to set up your Measurement list. mcDAQListInitialize does not start the transmission of the DAQ lists from the ECU to the application or vice versa through XCP or CCP. This enables you to use mcSetProperty to change the properties of a Measurement task. After you change properties use mcDAQStartStop to start the communication for the Measurement task. To query the available DAQ list entry numbers use mcGetProperty with the property mcPropECU_DAQListNumbers.