找回密码
 注册
搜索
查看: 1283|回复: 3

[讨论] 使用cvi gpib.h的控制软件,是不是只能用NI的GPIB卡?

[复制链接]
发表于 2010-5-25 14:24:06 | 显示全部楼层 |阅读模式
示例代码:
          N4010A_BT = ibdev (0, N4010A_addr, NO_SAD, T10s, 1, 0);
         strcpy(write_buffer_NA,"*IDN?");      
         n4010A_status = ibwrt (N4010A_BT, write_buffer_NA,strlen(write_buffer_NA));
         
         memset(read_buffer_NA, 0 , sizeof(read_buffer_NA));
         n4010A_status = ibrd (N4010A_BT,read_buffer_NA , 100);

使用cvi gpib.h里面的函数(ibdev/ibwrt/ibrd)来访问GPIB卡,是不是只能使用NI的gpib卡?

我使用agilent的GPIB卡,就是不行!同时装了NI488.2也不行。ibdev返回值是-1。

MTK ATE控制N4010和heithley 2303都是用的这些gpib.h的函数做的控制程序,使用agilent GPIB都不行。

麻烦给个提示,谢过。
 楼主| 发表于 2010-5-27 11:39:06 | 显示全部楼层
恍然大悟。搞明白了,谢谢关注。
点评回复

使用道具 举报

发表于 2010-5-27 20:17:03 | 显示全部楼层
下面是Agilent的SICL的一个例子,差别很大,对吧?

/* gpibdev.c
This example program sends a scan list to a
switch and, while looping, closes channels and
takes measurements. */
#include <sicl.h>
#include <stdio.h>
main()
{
INST dvm;
Using SICL with GPIB 4
Agilent SICL User’s Guide 91
INST sw;
double res;
int i;
/* Log message and terminate on error */
ionerror (I_ERROR_EXIT);
/* Open the multimeter and switch sessions*/
dvm = iopen (“gpib0,9,3”);
sw = iopen (“gpib0,9,14”);
itimeout (dvm, 10000);
itimeout (sw, 10000);
/*Set up trigger*/
iprintf (sw, “TRIG:SOUR BUS\n”);
/*Set up scan list*/
iprintf (sw,”SCAN (@100:103)\n”);
iprintf (sw,”INIT\n”);
for (i=1;i<=4;i++)
{
/* Take a measurement */
iprintf (dvm,”MEAS:VOLT:DC?\n”);
/* Read the results */
iscanf (dvm,”%lf”,&res);
/* Print the results */
printf (“Result is %lf\n”,res);
/* Trigger to close channel */
iprintf (sw, “TRIG\n”);
}
/* Close the multimeter and switch sessions */
iclose (dvm);
iclose (sw);
return 0;
}
点评回复

使用道具 举报

 楼主| 发表于 2010-5-31 11:36:25 | 显示全部楼层
上述代码中的函数,应该就是Agilent的GPIB函数了。倒是第一次见,谢谢支持!
点评回复

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

Archiver|手机版|小黑屋|52RD我爱研发网 ( 沪ICP备2022007804号-2 )

GMT+8, 2024-9-22 07:19 , Processed in 0.045425 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表