完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
|
我是用Agilent VISA程序库,按照visa手册对vc进行设置,粘了一个实现IDN?功能的程序,编译链接没问题,但执行试并没有得到仪器名称。仪器在visa assistant中已经查到并能实现idn?功能。程序如下:
/*idn.c This example program queries a GPIB device for an identification string and prints the results. Note that you must change the address. */ #include #include void main () { ViSession defaultRM, vi; char buf [256] = {0}; /* Open session to GPIB device at address 22 */ viOpenDefaultRM (&defaultRM); viOpen (defaultRM, "GPIB0::22::INSTR", VI_NULL,VI_NULL, &vi); /* Initialize device */ viPrintf (vi, "*RSTn"); /* Send an *IDN? string to the device */ viPrintf (vi, "*IDN?n"); /* Read results */ viScanf (vi, "%t", &buf); /* Print results */ printf ("Instrument id string: %sn", buf); /* Close session */ viClose (vi); viClose (defaultRM); } |
|
相关推荐
3个回答
|
|
|
不懂这个
|
|
|
|
|
|
|
|
|
|
|
|
感谢楼主分享~~~
|
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-1 22:59 , Processed in 0.541849 second(s), Total 77, Slave 59 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
6057