02.01.2015 Views

Model 3988 Op Manual.vp - Krohn-Hite Corporation

Model 3988 Op Manual.vp - Krohn-Hite Corporation

Model 3988 Op Manual.vp - Krohn-Hite Corporation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Section 3 - IEEE-488 STD (GPIB) Programming<br />

/*<br />

* Read the K-H <strong>3988</strong> again like before.<br />

*/<br />

ibrd (GpibDev,rd,30L);<br />

if (ibsta & ERR) gpiberr(“ibrd Error”);<br />

rd[ibcnt] = ‘\0’;<br />

printf(“Read: %s\n”, rd);<br />

ibcmd(GpibBoard,"_",2L); /* send unt, unl */<br />

if (ibsta & ERR) gpiberr(“ibcmd Error”);<br />

/* Call the ibonl function to disable the hardware and software. */<br />

ibonl (GpibDev,0); /* Release the device handle */<br />

ibonl (GpibBoard,0); /* Release the board handle */<br />

exit(0); /* exit with no error */<br />

} /* main */<br />

/*==================================================================<br />

* Function GPIBERR<br />

* This function will notify you that a NI-488 function failed by<br />

* printing an error message. The status variable IBSTA will also be<br />

* printed in hexadecimal along with the mnemonic meaning of the bit position.<br />

* The status variable IBERR will be printed in decimal along with the<br />

* mnemonic meaning of the decimal value. The status variable IBCNT will<br />

* be printed in decimal.<br />

*<br />

* The NI-488 function IBONL is called to disable the hardware and software.<br />

*<br />

* The EXIT function will terminate this program.<br />

*===================================================================<br />

3-17

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

Saved successfully!

Ooh no, something went wrong!