BNC 1105 Universal Counter User Manual

Page 172

Advertising
background image

172

172

172

172

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 Visa 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);

//send Clear command '*CLS'-- Clear MODEL 1105 status register

stat = viWrite(sesn, (unsigned char *)("*CLS"), 4, &ret);

//send reset command 'INIT:CONT ON' -- Initial MODEL 1105

stat = viWrite(sesn, (unsigned char *)("INIT:CONT ON"), 12, &ret);

//Send commands befor measure (required)

/*----------------------------- CH1 Input Condition -----------------------------*/

stat = viWrite(sesn, (unsigned char *)("INP1:IMP 1000000"), 16, &ret);

stat = viWrite(sesn, (unsigned char *)("INP1:COUP AC"), 12, &ret);

Advertising