跳转至

DLLDataCollectionGetData

函数 DLLDataCollectionGetData 按起始索引读取已采集的样本数据。(从控制器的循环缓冲区中读取数据,支持在采集过程中读取。)

所属:C/C++ API 函数索引

C/C++

ErrorCode DLLDataCollectionGetData(INT_PTR hClientHandle, unsigned int startSample, unsigned int sampleCount, double* outData);

C#

Controller.DataCollection 门面为本版本内部 API;请使用本 C API 或 Digital Scope 应用。

参数

hClientHandle (INT_PTR)

客户端会话句柄,由 DLLSysConnect 获取。

startSample (unsigned int)

读取起始样本索引(0-indexed)。

sampleCount (unsigned int)

要读取的样本点数量。每个样本点包含所有通道的数据(按通道顺序依次排列),因此 outData 数组大小应为 sampleCount * channelCount

outData (double*)

输出。接收读取的样本数据。数据布局:前 channelCount 个 double 对应样本 0 的各通道值,接下来 channelCount 个对应样本 1,以此类推。

返回值

返回 ErrorCodeNoError (0) 表示成功,DataCollectError 表示读取失败,详见 SDK 发布头 ErrorCode.h。

示例

double data[1000] = {0};
DLLDataCollectionStart(handle);
/* 采集完成后读取 */
DLLDataCollectionGetData(handle, 0, 1000, data);

相关函数