欢迎来到虫虫下载站 | 资源下载 资源专辑 关于我们
虫虫下载站

ua300vc.cpp

数模转换程序
CPP
字号:
// ua300vc.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "windows.h"
#include "stdafx.h"
#include "ua300.h"

HANDLE husb;

int main(int argc, char* argv[])
{

short int ch;
short int i,j;
short int addat[4096];

printf("Hello World!\n");
	
husb=OpenUA300();                  // 打开设备,得到句柄

printf("\ntest 1 \n");	
ssinit(husb); 
                       // 单点采集初始化



dout(husb,0x55);

printf("%x \n",din(husb));

// 显示0-7通道数据8次
for(i=0;i<8;i++){
   for(ch=0;ch<8;ch++){
      printf("%+2.4f  ",(short int)(ssad(husb,ch,0)-2048)*.002442);   
   }
   printf("\n");
}

printf("\ntest 2 \n");
minit(husb,0,8,0);                      // 多点采集初始化,0-7通道,倍数1
readdata(husb, addat,300,256);           // 多点采集, 20 KHz, 256字节 

//  显示数据
j=0;
for(i=0;i<8;i++){
   for(ch=0;ch<8;ch++){
      printf("%6d  ",addat[j++]-2048);

   }
printf("\n");
}

husb=CloseUA300(husb);              //

return 0;

}





⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -