Agilent Technologies 8164A Manual De Usuario
How Power Varies with Wavelength
VISA Programming Examples
Agilent 8163A/B, 8164A/B & 8166A/B Mainframes, Fifth Edition
203
How Power Varies with
Wavelength
Wavelength
This example shows how the measured power depends on wavelength.
Install a Power Sensor in Slot 1 and a Tunable Laser Source in Slot 2 and
connect the Tunable Laser Source output to the Power Sensor input,
before executing this example.
connect the Tunable Laser Source output to the Power Sensor input,
before executing this example.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <visa.h>
/* function prototypes for this examples*/
/* function for a simple error handling explained in example 1 */
void checkError(ViSession session, ViStatus err_status );
void main (void)
{
ViStatus errStatus; /* returned error code from visa call */
ViSession defaultRM; /* default visa resource manager
variable*/
variable*/
ViSession vi; /* current session handle */
ViChar replyBuf[256]; /*buffer holding answers of the
instrument */
instrument */
ViChar c; /* used in the keyboard wait loop */
ViReal64 wavelength; /* used to hold the wavelength of the
tunable laser source */
tunable laser source */
ViReal64 wavelength_max; /*used to hold the maximum
wavelength of the tunable laser source*/
wavelength of the tunable laser source*/
ViInt32 i; /* loop counter */
ViInt32 cmdDone; /* return value for OPC command */
errStatus = viOpenDefaultRM (&defaultRM);
if(errStatus < VI_SUCCESS)
{
printf("Failed to open VISA Resource manager\n");
exit(errStatus);
}