|Download Help (Windows Only)|
Initializes a Measurement task for the specified scaled Measurement channel list.
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 is the task reference which links to the selected ECU. This reference is originally returned from mcECUSelectEx.
DAQMode specifies the I/O mode for the task. For an overview of the I/O modes, including figures, refer to the Basic Programming Model topic.
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.
In this mode the data from the Measurement task are uploaded from the ECU whenever the mcDAQRead function is called.
For XCP, this defines a DAQ list for data stimulation (STIM). Within a DAQ task initialized with this parameter, you can call mcDAQWrite to write stimulation data to the ECU. Calling mcDAQRead is not allowed. For CCP, an error is returned.
The data is transmitted from the ECU in equidistant time intervals as defined in the A2L database. The data can be read back with mcDAQReadTimestamped as timestamped data array. Input channel data are received from the DAQ messages. Use mcDAQReadTimestamped to obtain input samples as an array of sample/timestamp pairs. Use this input mode to read samples with timestamps that indicate when each channel is received from the network.
DTO ID is the CAN identifier for the Data Transmission Object (DTO) used to transmit the data from the DAQ lists to the host. 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.
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.
DAQRefNum is the reference handle for the Measurement task. Use this Measurement task reference in subsequent M&C DAQ functions for this task.
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.
mcDAQInitialize does not start the transmission of the DAQ lists on the ECU. This enables you to use mcSetProperty to change the properties of a Measurement task. After you change properties, use mcDAQStartStop to start the transmission of the Measurement task.