13.07.2015 Views

Model SR715 Model SR720 LCR Meters

Model SR715 Model SR720 LCR Meters

Model SR715 Model SR720 LCR Meters

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

REMOTE PROGRAMMINGTxGpib (sr720,"OUTF2"); /* verbose binary output */TxGpib (sr720,"STRT;*WAI;XALL?");/* trigger a measurement, wait until it's over, thenask for results */MakeTalk (sr720); /* make <strong>LCR</strong> a GPIB talker */count = 15;rarray (&status, &length, &count, data, &seg); /* read output into array data[] *//* Check the programming section of the <strong>SR720</strong> fordetailed information on binary return formats. *//* split up status byte to check for errors and measurement type */errs = data[2] & 15; /* mask = 0000 1111 */mtype = data[2] & 48; /* mask = 0011 0000 */mtype /= 16; /* now mtype = 0000 00xx */switch (errs){case 0:case 1:case 2:case 4:case 8:case 15:default:}printf ("Measurement ok (no errors).\n"); break;printf ("? No measurement made ?\n"); break;printf ("Measurement overloaded.\n"); break;printf ("Underrange error.\n"); break;printf ("Overrange error.\n"); break;printf ("Out of range error.\n"); break;break;/* transfer major parameter bytes(4) to create a single precision FP number */memcpy (&maj, &data[3], 4); /* store four bytes as a floating point number *//* now do the same for the minor parameter. */memcpy (&min, &data[8], 4);printf ("%s = %7.4e, %s = %7.5e.\n", mmaj[mtype], maj, mmin[mtype], min);}/* ******************************************************************* */void InitGpib (void) /* initialize the CEC GPIB card as controller */{int my_address, system_controller;unsigned seg;/* find cec card address */for ( seg=0x4000 ; seg < 0xF000 ; seg += 0x400 ){ if ( (peek (seg,50) == 'C') && (peek (seg,51) == 'E') && (peek (seg,52) == 'C') ) break; }if ( pc488_seg(seg)){ printf ( " no gpib card installed\n"); exit(0); }my_address = 21;system_controller = 0;initialize (&system_controller, &my_address); /* init controller (CEC) function */transmit (&status, "IFC UNT UNL DCL REN"); /* device clear and remote enable */}/* ********************************************************************* */void MakeTalk (int address) /* make device at address a talker */{4-15

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!