Programming Examples
How to Use VISA Calls
/* get the identification string of the instrument mainframe*/
errStatus = viQueryf(vi,"%s\n","%t","*IDN?",replyBuf);
if(errStatus < VI_SUCCESS)
{
checkError(vi,errStatus);
}
else printf("%s",replyBuf);
/* identify the installed modules */
errStatus = viQueryf(vi,"%s\n","%t","*OPT?",replyBuf);
if(errStatus < VI_SUCCESS)
{
checkError(vi,errStatus);
}
else printf("%s",replyBuf);
/* get information about the available options of a slot */
errStatus = viQueryf(vi,"%s","%t","SLOT1:OPT?\n",replyBuf);
if(errStatus < VI_SUCCESS)
{
checkError(vi,errStatus);
}
else printf("%s",replyBuf);
/*loop, until a key is pressed */
while(!scanf("%c",&c));
/*close the session */
viClose(vi);
}
143