📄 ua300vc.cpp
字号:
// ua300vc.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "windows.h"
#include "stdafx.h"
#include "ua300a.h"
HANDLE husb;
int main(int argc, char* argv[])
{
short int ch;
short int i,j;
short int addat[51200];
printf("Hello World!\n");
husb=OpenUA300(); // 打开设备,得到句柄
printf("\ntest 1 \n");
ssinit(husb); // 单点采集初始化
// 显示0-7通道数据8次
for(i=0;i<8;i++){
for(ch=0;ch<8;ch++){
printf("%6d ",(short int)ssad(husb,ch,0));
}
printf("\n");
}
printf("\ntest 2 \n");
minit(husb,0,9,0); // 多点采集初始化,0-7通道,倍数1
readdata(husb, addat,60,256); // 多点采集, 100 KHz, 256字节
// 显示数据
j=0;
for(i=0;i<8;i++){
for(ch=0;ch<9;ch++){
printf("%6d ",addat[j++]);
}
printf("%4d \n",i);
}
printf("\ntest 3 \n");
minit2(husb,0,8,6000,0); // 多点采集初始化,0-7通道, 1KHz,倍数1
readdata2(husb, addat,256); // 多点采集, 256点
j=0;
for(i=0;i<2;i++){
for(ch=0;ch<8;ch++){
printf("%6d ",addat[j++]);
}
printf("\n");
}
//readdata2(husb, addat,256); // 多点采集, 256点
j=0;
for(i=0;i<2;i++){
for(ch=0;ch<8;ch++){
printf("%6d ",addat[j++]);
}
printf("\n");
}
//readdata2(husb, addat,256); // 多点采集, 256点
j=0;
for(i=0;i<2;i++){
for(ch=0;ch<8;ch++){
printf("%6d ",addat[j++]);
}
printf("\n");
}
//endread2(husb);
printf(" %4x ",din(husb));
husb=CloseUA300(husb); //
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -