濾波器型號是siglent 的sds3054
具體的代碼很簡單
.........
status = viPrintf(instr, "BandWidth_Limit?\n");
status = viScanf(instr, "%t", outputBuffer);
if (status<VI_SUCCESS)
{
printf("viRead failed with error code: %x \n",status);
viClose(defaultRM);
}else
{
printf ("\ndata read from device: %*s\n", 0,outputBuffer);
}
.........
往濾波器發送BandWidth_Limit?以及其他的指令的時候會出現
data read from device: WARNING : CURRENT REMOTE CONTROL INTERFACE IS TCPIP,并不是我想要的回傳值。
但是發送*idn?指令卻能得到想要的結果
data read from device: LECROY,SDS3054,SDS300B21443023,7.9.2
uj5u.com熱心網友回復:
這個是前面的代碼status = viOpenDefaultRM (&defaultRM);
// printf("status:%x",status);
if (status<VI_SUCCESS)
{
printf("Could not open a session to the VISA Resource Manager!\n");
}
/*
拼接IP地址,并連接。
*/
char head[256] = "TCPIP0::";
char tail[] = "::INSTR";
char resource[256];
strcat(head,pIP);
strcat(head,tail);
status = viOpen (defaultRM, head, VI_LOAD_CONFIG, VI_NULL, &instr);
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/72776.html
標籤:網絡及通訊開發
上一篇:struct 型別重定義
