inline test_1() {
ibwrt(meter,"CONF:VOLT:DC DEF,DEF",21);
ibwrt(meter,"VOLT:DC:NPLC 1",14);
ibwrt(meter,"TRIG:SOUR IMM",13); if( fabs(Vo[0]) > 0 ) { iov=1; ea=0; return_v(); ch=SCH[0]; }
if( fabs(Vo[1]) > 0 ) { iov=2; ea=1; return_v(); ch=SCH[1]; }
if( fabs(Vo[2]) > 0 ) { iov=4; ea=2; return_v(); ch=SCH[2]; }
if( fabs(Vo[3]) > 0 ) { iov=8; ea=3; return_v(); ch=SCH[3]; } sprintf(show_err,"(1)NOM 輸出電壓(V) "); sprintf(result_1,"NOM 輸出電壓(V) "); if( fabs(Vo[0]) > 0 ) { ch=1; ea=0; if_else1(); }
if( fabs(Vo[1]) > 0 ) { ch; ea=1;
if(Form1->agseries->Text=="PFKC05-15D0515" ||
Form1->agseries->Text=="PM-02CD52" ||
Form1->agseries->Text=="PM-02CD52A" ||
Form1->agseries->Text=="PFKC05-15D0515-RE" ||
Form1->agseries->Text=="PM-02CD52-RE" ||
Form1->agseries->Text=="PM-02CD52A-RE"||
PMKC=="DS" || MKC=="DS"||
Form1->agseries->Text=="PFKC05-15D0515F" ||
Form1->agseries->Text=="PFKC05-15D0515F-RE")
{vout[ea]=-vout[ea];}
if_else1();
}
if( fabs(Vo[2]) > 0 ) { ch; ea=2; if_else1(); }
if( fabs(Vo[3]) > 0 ) { ch; ea=3; if_else1(); } if (err==0)Form1->ListBox1->Items->Add(result_1);
if (err==1)Form1->ListBox2->Items->Add(show_err); Form1->ProgressBar1->Position=8.3;
Form1->Label68->Font->Color=clRed;
return(0);
}
inline if_else1()
{
sprintf(pr1,""); sprintf(pr2,"");
dat=(fabs(vout[ea]) - fabs(Vo[ea]))/fabs(Vo[ea])*100 ;
if( -Rg[ea] <= dat )
{ if( Rg[ea] >= dat )
{ sprintf(pr1,"第%d組= %.3f正常 ", ch, vout[ea]);
strcat(result_1,pr1);
}
else { err=1;sprintf(pr2,"第%d組= %.3f過高(代碼:1-3)", ch, vout[ea]);
memset(result_1,'\0',1);
strcat(show_err,pr2);
}
}
else
{
err=1; sprintf(pr2," 第%d組= %.3f過低(代碼:1-2)", ch, vout[ea]); if( dat <= -15 ) { sprintf(pr2,""); sprintf(pr2,"第%d組= 無輸出(代碼:1-1)", ch);
}
memset(result_1,'\0',1);
strcat(show_err,pr2);
} return(0);
}
|