Main Content

通过动态 DAQ 列表采集测量数据

此示例说明如何创建一个动态数据采集列表并从列表事件中读取测量值。您可以从服务器采集此列表中的测量变量数据。

创建链接到 A2L 文件的 XCP 通道并将其连接到服务器。

a2lfile = xcpA2L('C:\work\XCPSIM.a2l');
xcpch = xcpChannel(a2lfile,'CAN','Vector','Virtual 1',1);
connect(xcpch)

使用 'PWMFiltered''Triangle' 测量变量为 '10 ms' 事件创建 DAQ 列表。

createMeasurementList(xcpch,'DAQ','10 ms',{'PWMFiltered','Triangle'});

开始测量活动。

startMeasurement(xcpch)

从配置的测量变量列表中的 'Triangle' 测量变量读取 10 个数据样本。

readDAQListData(xcpch,'Triangle', 10)
18   18   18   18   18   18   18   18   18   18