专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > C++ Builder

名称异常"TCPIP0:10.41.129.111:inst0:INSTR"

发布时间:2011-06-28 14:03:47 文章来源:www.iduyao.cn 采编人员:星星草
名称错误"TCPIP0::10.41.129.111::inst0::INSTR"
viOpen返回错误代码:–1073807342 VI_ERROR_INV_RSRC_NAME Invalid resource reference specified. Parsing error.
已经知道是名称错误,但是度过好多,都不能正确

------解决方案--------------------
大哥啊,你为什么不照着人家的例子来写呢,你都不找资源就直接用有没有搞错啊

int FindRSrc(void)
{
char instrDescriptor[VI_FIND_BUFLEN];
ViUInt32 numInstrs;
ViFindList findList;

status = viOpenDefaultRM(&defaultRM);
if ( status < VI_SUCCESS ) {
DebugLogf("Could not open a session to the VISA Resource Manager!");
return status;
}

status = viFindRsrc( defaultRM, "TCPIP?*INSTR", &findList, &numInstrs, instrDescriptor );
if ( status < VI_SUCCESS ) {
DebugLogf("An error occurred while finding resources.");
return status;
}

if ( numInstrs > 0 ) {
Agilent->ComboBox_GPIB->Items->Add(instrDescriptor);
}

status = viOpen( defaultRM, instrDescriptor, VI_NULL, VI_NULL, &instr );

while ( --numInstrs ) {
status = viFindNext( findList, instrDescriptor );
if ( status < VI_SUCCESS ) {
DebugLogf("An error occurred finding the next resource.");
return status;
}
//这个时候的instrDescriptor就是你电脑上找到的资源,并且可用,如果为空就说明你的连线有问题
}

viClose(instr);
viClose(findList);

return status;
}
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: