6
Example 5 - Increased Tuning Linearity
C Listing
/*-------------------------------------------------------------------------*
*
* File: set_wave.c
*
* Notes:
*
* o You have to include <math.h>, <your_hpib_interface.h> to use
* these functions.
*
* o There is no error handling shown here.
*
* o Instruments are not initialized here.
*
* o Maybe you should wait until your instruments have completed
* their operations. (e.g. Wait for OPC on HP 8167/68)
*
* o In this example we use the hpib library SICL
* (Standard Instrument Control Library);
* used commands:
* - iopen open an instrument (like fopen)
* - iclose close an instrument (like fclose)
* - iprintf send a message to an instrument (like fprintf)
* - iscanf get a message from an instrument (like fscanf)
* - ipromptf a combination of iprintf and iscanf
* the type INST is an instrument handle (like FILE)
*
* o to compile we use the command
* cc -Aa -o set_wave set_wave.c -lsicl -lm
*
*
*
*-------------------------------------------------------------------------*/
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <sicl.h> /* for our hpib library */
int SetExactWvl (double theWvl); /* function prototypes */
double GetWavelength (INST theInstrument);
/*-------------------------------------------------------------------------*/
int main (int argc, char **argv)
/*-------------------------------------------------------------------------*/
{
double theWvl;
Programming Examples 6-17