BNC 1105 Universal Counter User Manual
Page 194

194
194
194
194
int tmo;
printf("\n ###### Start C++ Example program. ######\n");
printf(" We check the Counter on USB port and\n");
printf(" identify the first connected device.\n\n");
/* Begin by initializing the system */
stat = viOpenDefaultRM(&defaultRM);
if (stat < VI_SUCCESS) {
/* Error Initializing VISA...exiting */
printf ("Error Initializing NI-VISA...");
return 0;
}
stat = viFindRsrc (defaultRM, "USB[0-9]::0x164E::0x0FA4::?*INSTR",
&flist, &ret, rsrcName);
stat = viOpen (defaultRM, rsrcName, VI_NULL, VI_NULL, &sesn);
if (stat < VI_SUCCESS)
{
printf ("Could not open %s, status = 0x%08lX\n",rsrcName, stat);
return 0;
}
else
{
stat = viGetAttribute (sesn, VI_ATTR_INTF_INST_NAME, intfDesc);
printf ("Resource %s, Description %s\n", rsrcName, intfDesc);
}
stat = viFindNext (flist, rsrcName);
//Setting Process Timeout
stat = viGetAttribute(sesn, VI_ATTR_TMO_VALUE, &tmo);
stat = viSetAttribute(sesn, VI_ATTR_TMO_VALUE, 30000);
//send reset command '*RST' -- reset MODEL 1105
stat = viWrite(sesn, (unsigned char *)("*RST"), 4, &ret);