|Download Help (Windows Only)|
Writes scaled and raw samples to an ECU DAQ list.
DAQRefNum is the task reference from the previous Measurement task function. The task reference is originally returned from mcDAQInitializeEx, and then reused by subsequent Measurement task functions.
NumberofSamplesToWrite specifies the number of samples to write for the ECU MC DAQ task to the ECU DAQ list. For single-sample output, pass 1 to this parameter. The initialized DAQ sample rate is ignored. mcDAQWriteEx immediately writes a single sample to the ECU when calling the mcDAQWriteEx function.
SampleArray specifies a 2D array, one array for each scaled channel initialized in the task. The array of each channel must have NumberOfSamplesToWrite entries allocated. The order of channel entries in SampleArray is the same as the order in the original MeasurementNames. If you must determine the number of channels in the task after initialization, get the mcPropDAQ_NumChannels property for the task reference.
RawSampleArray specifies a 2D array, one array for each raw channel initialized in the task. The array of each channel must have NumberOfSamplesToWrite entries allocated. The order of channel entries in RawSampleArray is the same as the order in the original RawMeasurementNames. If you must determine the number of channels in the task after initialization, get the mcPropDAQ_NumRawChannels property for the task reference.
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.
For XCP STIM lists (refer to mcDAQInitializeEx), mcDAQWriteEx transfers an array of samples to the ECU. These samples are called data stimulation packets (STIM). On the ECU side the STIM processor buffers incoming data stimulation packets. When an event occurs, which triggers a DAQ list in data stimulation mode, the buffered data is transferred to the memory on the slave device.
Refer to the ASAM XCP Part 2 Protocol Layer Specification for more information on how to configure data stimulation.