Agilent Technologies 86100-90086 Sprinkler User Manual


 
2-38
Sample Programs
Listings of the Sample Programs
write_IO("CALibrate:SKEW:AUTO");//auto deskew the two channels
write_IO("*OPC?"); //query for completion
read_IO(buff,5); //read completion response
write_IO("MTESt:LOAD \"STM016_OC48.msk\"");//load OC-48 mask
write_IO("MTESt:SOURce CHANnel1");//set mask test channel1
write_IO("MTESt:START"); //start mask test
write_IO("MTESt:COUNt:FSAMples?");//query the number of failed samples
Msk_hits1[read_IO(Msk_hits1, 15)]=0;//get the number of mask hits
write_IO("MTESt:SOURce CHANnel3");//mask test channel3
write_IO("MTESt:TEST ON"); //start mask test
write_IO("MTESt:COUNt:FSAMples?");//query the number of failed samples
Msk_hits2[read_IO(Msk_hits2, 15)]=0;//get the number of mask hits
write_IO("MEASure:CGRade:SOURce CHANnel1"); //measure Channel 1
write_IO("MEASure:CGRade:CROSsing?");//query the crossing percentage
Crss_pct1[read_IO(Crss_pct1,15)]=0;//get the crossing percentage
write_IO("MEASure:CGRade:ERATio? DECibel");//query the extinction ratio
Ext_rat1[read_IO(Ext_rat1,15)]=0;//get the extinction ratio
write_IO("MEASure:CGRade:SOURce CHANnel3"); //measure Channel 1
write_IO("MEASure:CGRade:CROSsing?");//query the crossing percentage
Crss_pct2[read_IO(Crss_pct2,15)]=0;//get the crossing percentage
write_IO("MEASure:CGRade:ERATio? DECibel");//query the extinction ratio
Ext_rat2[read_IO(Ext_rat2,15)]=0;//get the extinction ratio
stop = clock();
//display the results
printf("Channel 1:\n Mask hits:%s Crossing %%:%s Extinction Ratio:%s\n",
Msk_hits1,Crss_pct1,Ext_rat1);
printf("Channel 3:\n Mask hits:%s Crossing %%:%s Extinction Ratio:%s\n",
Msk_hits2,Crss_pct2,Ext_rat2);
return (stop-start); //return the total run time
return 1;
}//acquireParallel()
init.bas Sample Program
10 !file: init
20 !
30 !
40 ! This program demonstrates the order of commands suggested for operation of
50 ! the Agilent 86100 analyzer via GPIB. This program initializes the scope, acquires
60 ! data, performs automatic measurements, and transfers and stores the data on the