zoukankan      html  css  js  c++  java
  • NI采集卡多通道赋值之 memset/memcpy

    int  m_NI_Para_nPoints = 1000//一个通道点数
    int  m_NI_Para_nChan  = 8//通道数 ,8通道
    //创建总数组,总数组长度为 m_NI_Para_nPoints * m_NI_Para_nChan 个点,共8000
    float64 *output_DATA  = NULL;
    
    if (NULL == output_DATA)
        {
    output_DATA
    = new float64[m_NI_Para_nPoints * m_NI_Para_nChan]; //数组置零 memset(output_DATA, 0, sizeof(float64)*(m_NI_Para_nPoints)); } //NI写入模式为 DAQmx_Val_GroupByChannel //8个通道数据各不相同,此处假设将第4通道数据赋给总数组,float64 p_data_value[]为已知的第四通道数据 int iChan = 4; memcpy(&output_DATA[iChan * m_NI_Para_nPoints], p_data_value, sizeof(float64)*m_NI_Para_nPoints);

    此时只给总数组output_DATA中的第3000~4000个值赋上数组p_data_value的值

  • 相关阅读:
    C#练习3
    C#练习2
    C#环境变量配置及csc命令详解(转自cy88310)
    建站流程(转)
    C#练习
    程序竞赛1
    排序算法
    输出有向图的邻接矩阵
    C#高效分页代码(不用存储过程)
    存储过程详解
  • 原文地址:https://www.cnblogs.com/zzzsj/p/15603959.html
Copyright © 2011-2022 走看看