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 161
if (( AT C_st atu s = viRea d (AT CGen Se ss ion [(ATCGen -1)] , (ViPBuf )rea dBu ffer,
n umb erByte sT oRe ad , (ViPUIn t32 )nu mByte sRea d)) < 0 )
{ / / Re try es pe cia lly in ca se of time ou t
// Lo g th is a s t he las t co mma nd tra ns missio n time
if ((ATC_s tatu s = ATC_ nx tCmd Lo g ( AT CGe nSe ssio n[( AT CGe n- 1)],
WAIT T IME0 _0 3)) < 0 )
retu rn AT C_s tatu s;
me mse t (re ad Bu ffer , 0x 0, s ize of ( rea dBu ffer) );
if ((ATC_s tatu s = ATC_ nx tCmd Wait ( AT CGe nSe ssio n[ (AT CGen -1)]) ) < 0)
retu rn AT C_s tatu s;
if ((ATC_s tatu s = ATC_ writ eIn strDa ta(AT CGe nSes sio n[(AT CGe n-1 )],
(ViStrin g) Ou tBuffe r, WAIT TIME0_ 03 )) < 0 )
retu rn AT C_s tatu s;
// Lo g th is a s t he las t co mma nd tra ns missio n time
if ((ATC_s tatu s = ATC_ nx tCmd Lo g ( AT CGe nSe ssio n[( AT CGe n- 1)],
WAIT T IME0 _0 3)) < 0 )
retu rn AT C_s tatu s;
// Make su re to wa it the minimu m amo un t of time b etwe en co mma nd s
if ((ATC_s tatu s = ATC_ nx tCmd Wait ( AT CGe nSe ssio n[ (AT CGen -1)]) ) < 0)
retu rn AT C_s tatu s;
if ((ATC_s tatu s = v iRe ad (ATCGen Sess ion [(ATCGen -1 )], (ViPBu f)re ad Bu ffe r,
n umb erByte sT oRe ad , (ViPUIn t32 )nu mByte sRea d)) < 0 )
retu rn AT C_s tatu s;
}
// L og th is a s th e la st c omma nd tra nsmis sio n time
if (( AT C_st atu s = ATC_n xtCmdL og (ATCGe nSes sio n[(AT CGe n-1 )],
WAIT T IME0 _0 3)) < 0 )
r etu rn AT C_ sta tus ;
in de x = Fin dPa ttern (re ad Buffe r, 0 , -1, "\r", 0 , 0); // Fin d CR
if (in de x ! = -1 )
{ // Remov e lin e fee d
r ea dBuffe r[in de x] = 0;
* nu mBy tes Re ad = strle n ( rea dBuf fer);
}
e lse
{
if (Fin dPa tter n (re so ur ceNa me, 0 , -1 , "GPIB", 0 , 0 ) != -1)
{ // n o c arra ge re turn o n g pib ret urn
}
e lse
{ // In co mple te re ad
retu rn AT C_ERROR_INVAL ID_COMMAND;
}
}
j = 0;
mems et ( Eq ua l, 0 , siz eo f (Equ al));
mems et ( Se pa rat or, 0 , s izeo f (Se pa rato r));
fo r (i = 0; i <= *n umByte sRea d; ++ i) // Se p ara te p ar amet ers
{
if (rea dBu ffer[ i] == 0x 3d ) / / =
Eq ua l[j] = i; // Sto re ind ex of = sig n
if (rea dBu ffer[ i] == 0x 3b || // ;
(rea dBu ffer [i] == 0 xd && Equ al[0 ] != 0) || // CR
Содержание 138156
Страница 3: ......