求详细解释下面的代码和注释

C++语言 码拜 8年前 (2016-04-15) 978次浏览
For C and Visual Basic users, the waveforms are all packed into a one-dimensional array that is declared using code such as the following:
// Set numWfms to 6, because the acquisition is for 2 channels times 3 records.
niScope_ActualNumWfms (vi, “0,1”, &numWfms);
// Fetch the coerced record length
niScope_ActualRecordLength (vi, &actualRecordLength);
// Declare memory for the waveforms and waveform info structs
wfm = malloc (sizeof (ViReal64) * actualRecordLength * numWfms);
wfmInfo = malloc (sizeof (struct niScope_wfmInfo) * numWfms);
The first waveform starts at wfm[0], the second waveform at wfm[actualRecordLength], and so on.
<http://zone.ni.com/reference/en-XX/help/370592Y-01/digitizers/fetching_multiple-record_acquisitions/>
解决方案

40

// Set numWfms to 6, because the acquisition is for 2 channels times 3 records.
//将numWfms设置为6,原因是是2条件通道,每条3个记录
// Fetch the coerced record length
//取得记录长度
// Declare memory for the waveforms and waveform info structs
//申请一块内存用于waveforms和waveform信息的结构体

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明求详细解释下面的代码和注释
喜欢 (0)
[1034331897@qq.com]
分享 (0)