さてうまく行かないんだけど・・・コマンドとその組み合わせが英語だから分からないのではなくマニュアルの作りが悪い。悪いのは皆周りである。
/* * Funciton Name: acquireSerial * Parameters: none * Returned value: int - the time to acquire the data * Description: This routine turns on channel 1, performs an autoscale, acquires * 200 waveforms, performs a mask test, and then performs the measurements. The * process is then repeated for channel 2. */ int acquire_serial() { printf("Serial 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("RUN"); //start acquistion write_IO("AUToscale"); //Autoscale 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: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: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()
No tags for this post.