Agilent Technologies 86100-90086 Sprinkler User Manual


 
2-37
Sample Programs
Listings of the Sample Programs
write_IO("MTESt:TEST OFF"); //trun off the maks test
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("CHANnel3:DISPlay ON");//turn on channel three
write_IO("RUN"); //start acquistion
write_IO("AUToscale"); //Autoscale
write_IO("*OPC?"); //query for completion
read_IO(buff,5); //read completion response
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: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);
}//acquireSerial()
/*
* Funciton Name: acquireParallel
* Parameters: none
* Returned value: int - the time to acquire the data
* Description: This routine is identical to acquireSerial, except that the data
* is aquired at the same time.
*/
int acquire_parallel()
{
printf("Parallel Acquisition In progress\n");//status report
//decalrations
int start=clock(),stop;
char Msk_hits1[16],Crss_pct1[16],Ext_rat1[16],buff[32];
char Msk_hits2[16],Crss_pct2[16],Ext_rat2[16];
write_IO("CHANnel1:DISPlay ON");//turn on channel one
write_IO("CHANnel3:DISPlay ON, APPEnd");//turn on channel three
write_IO("RUN"); //start acquistion
write_IO("AUToscale"); //Autoscale