Chapter 3
139
Programming Examples
Performing Alignments and Getting Pass/Fail Results
Performing Alignments and Getting Pass/Fail
Results
This C programming example (HPE4406Align.c):
• uses the VISA library for input/output, opens a session to a GP-IB
device at address 18 and presets the instrument
• increases the instrument timeout to one minute (60 sec) to allow
time for the auto-alignment to run
• runs the auto-alignment procedure
• queries the auto-alignment results and outputs the success/failure
information
Example:
#include <stdio.h>
#include <stdlib.h>
#include "visa.h"
void main ()
{
/*program variables*/
ViSession defaultRM, viVSA;
ViStatus viStatus= 0;
long lCalStatus = 0;
/*open session to GPIB device at address 18 */
viStatus=viOpenDefaultRM (&defaultRM);
viStatus=viOpen (defaultRM, "GPIB0::18::INSTR",
VI_NULL,VI_NULL, &viVSA);
/*check opening session sucess*/
if(viStatus)
{
printf("Could not open a session to GPIB device at
address 18!\n");
exit(0);
}
/*increase timeout to 60 sec*/
viSetAttribute(viVSA,VI_ATTR_TMO_VALUE,60000);
/*reset the instrument*/
viPrintf(viVSA, "*RST\n");
/*print message */
printf("The auto-alignment is in progress...\nPlease
wait...\n\n");
/*auto-align the instrument*/
viPrintf(viVSA, "CAL?\n");
Summary of Contents for E4406A VSA Series
Page 4: ...4 ...
Page 59: ...59 2 Programming Fundamentals ...
Page 124: ...124 Chapter2 Programming Fundamentals Using the LAN to Control the Analyzer ...
Page 125: ...125 3 Programming Examples ...
Page 164: ...164 Chapter3 Programming Examples Using Java Programming Over Socket LAN ...
Page 165: ...165 4 Programming Command Cross References ...
Page 379: ...379 6 Error Messages ...
Page 412: ...412 Chapter6 Error Messages Error Message Descriptions ...