8163A/B, 8164A/B & 8166A/B Mainframes Programming Guide
253
VISA Programming Examples
6
(!strncmp(errMsg,
"-301,\"Module doesn't support this command
(StatCmdUnknown)\"",
strlen(
"-301,\"Module doesn't support this command
(StatCmdUnknown)\""))))
{
printf("No power meter in slot 1 so exiting\n\
n");
exit(1);
}
}
}
}
ViStatus InitVisa ( ViSession *iHandle)
{
ViStatus errStatus; /* returned error code from
visa call */
ViSession defaultRM; /* default visa resource
manager variable */
/* First get initialized the visa library (see example 1)
*/
errStatus = viOpenDefaultRM (&defaultRM);
if (errStatus < VI_SUCCESS)
printf("Failed to open VISA Resource manager\n");
/* Open session to GPIB device at address 20; */
errStatus = viOpen (defaultRM, "GPIB::20::INSTR",
VI_NULL,VI_NULL,iHandle);
if (errStatus < VI_SUCCESS)
printf("Failed to open instrument\n");
return errStatus;
}