Operation, Remote Operation
Examples
Rev. L0
ATC-5000NG ATC/DME Test Set Operation Manual
1-2-5
February 2020
Subject to Export Control. See Cover Page for details.
Page 165
ViCha r d esc [],
ViCha r p n[])
{
ViSta tu s ATC_ sta tus = VI_ SUCCESS;
ViInt3 2 po s = -1;
ViCh ar tmpc ha r[10 0] = {0 };
//---- ------ ------- ------ ------ Ou tp ut to ATC - ------- ------ ------ ------
F mt (OutBuf fer, "%s <* IDN? ");
// Ch an ge timeo ut
if (( AT C_st atu s = viSet Attr ibu te (in str ume ntHan dle , VI_AT TR_T MO_VALUE,
T IME_OUT_ NORM_VAL)) <0 )
r etu rn AT C_ sta tus ;
if (( AT C_st atu s = ATC_write Ins trData (in stru men tHa n dle ,
(ViStrin g) Ou tBuffe r, WAIT TIME0_ 02 )) < 0)
r etu rn AT C_ sta tus ;
//---- ------ ------- ------ ------ Inp ut Pa rame ters ---- ------ ------ ------- -----
if (( AT C_st atu s = ATC_re ad In strDa ta (in str umen tHan dle , 1 50 , InBu ffer,
&by tes Rea d)) < 0 )
r etu rn AT C_ sta tus ;
// Re sto re
if (( AT C_st atu s = viSet Attr ibu te (in str ume ntHan dle , VI_AT TR_T MO_VALUE,
T IME_OUT_ NORM_VAL)) <0 )
r etu rn AT C_ sta tus ;
mfg [0] = NUL L;
d esc [0 ] = NULL ;
p n[0 ] = NULL ;
// Ma nu fac tur er
p os = F ind Pa tte rn ( InBuf fer, 0 , -1 , ";", 0 , 0 );
if (p os != -1)
{
F mt (mfg , "%s< %s[i0 w*]", p os, InBuf fer);
Re mo ve Surro un din gWh ite Sp ac e (mfg );
s trcp y ( tmpc ha r, InBu ffer );
F mt (In Bu ffe r, "%s< %s[i* w* ]", po s+ 1, (strle n( tmpc ha r)-p os) -1, t mp ch ar );
}
e lse
r etu rn AT C_ ERROR_INVAL ID_CONF IGURATI ON;
// In str ume nt d es crip tion
p os = F ind Pa tte rn ( InBuf fer, 0 , -1 , ";", 0 , 0 );
if (p os != -1)
{
F mt (d es c, "%s <%s [i0w*]", p os , In Bu ffe r);
Re mo ve Surro un din gWh ite Sp ac e (d es c);
s trcp y ( tmpc ha r, InBu ffer );
F mt (In Bu ffe r, "%s< %s[i* w* ]", po s+ 1, (strle n( tmpc ha r)-p os) -1, t mp ch ar );
}
e lse
r etu rn AT C_ ERROR_INVAL ID_CONF IGURATI ON;
// PN nu mbe r
Содержание 138156
Страница 3: ......