
2-25
Sample Programs
C Programming Examples
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
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()
Summary of Contents for 86100A
Page 18: ...1 14 Introduction Status Reporting Figure 1 4 Status Reporting Data Structures...
Page 19: ...1 15 Introduction Status Reporting Status Reporting Data Structures continued...
Page 94: ...2 40 Sample Programs BASIC Programming Examples...
Page 124: ...4 16 Root Level Commands VIEW...
Page 132: ...5 8 System Commands TIME...
Page 140: ...6 8 Acquire Commands SWAVeform RESet...
Page 152: ...7 12 Calibration Commands STATus...
Page 192: ...11 12 Display Commands SSAVer...
Page 202: ...12 10 Function Commands VERTical RANGe...
Page 203: ...13 AREA 13 2 DPRinter 13 2 FACTors 13 3 IMAGe 13 3 PRINters 13 4 Hardcopy Commands...
Page 316: ...21 12 TDR TDT Commands Rev A 05 00 and Below STIMulus...
Page 332: ......