资源简介
VISA读写程序,对示波器通信控制的例子,需要TEKVISA驱动程序的支持。
代码片段和文件信息
#include
#include “visa.h“
int main(int argc char* argv[])
{
ViSession rm vi;
ViStatus status;
char string[256];
ViUInt32 retCnt;
status = viOpenDefaultRM(&rm);
if (status < VI_SUCCESS) goto error;
status = viOpen(rm “GPIB8::1::INSTR“ NULL NULL &vi);
if (status < VI_SUCCESS) goto error;
status = viWrite(vi (ViBuf) “*idn?“ 5 &retCnt);
if (status < VI_SUCCESS) goto error;
status = viRead(vi (ViBuf) string 256 &retCnt);
if (status < VI_SUCCESS) goto error;
printf(“*idn response %s\n“ string);
viClose(vi);
viClose(rm);
return 0;
error:
viStatusDesc(rm status string);
fprintf(stderr “Error: %s\n“ (ViBuf) string);
return 0;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 716 2001-01-06 10:23 rwexam\rwexam.cpp
文件 4126 2001-04-20 12:47 rwexam\rwexam.dsp
文件 537 2001-04-20 12:45 rwexam\rwexam.dsw
..AD... 0 2006-10-22 14:33 rwexam\Release
..AD... 0 2006-10-22 14:33 rwexam
----------- --------- ---------- ----- ----
5379 5
- 上一篇:opengl 地球仪 glut
- 下一篇:夜班防睡控制和记录器
评论
共有 条评论