Operation, Remote Operation
Examples
1-2-5
ATC-5000NG ATC/DME Test Set Operation Manual
Rev. L0
Page 160
Subject to Export Control. See Cover Page for details.
February 2020
// rea dBuf fer - Str ing to write
// nu mBy tes Re ad - b yte s a ctu ally re ad
// Retu rn Va lue s: Z e ro o n s uc ce ss , no n-z ero o the rwise
//= == == == == = == == == == = == == == == = == == == == = == == == = == == == == = == == == == = == == == == = == == ==
ViSta tus _VI_ FUNC AT C_ re ad Ins trData (ViInt1 6 AT CGe n,
ViIn t32 n umbe rByte sT oRe ad ,
ViCha r _ VI_ F AR re ad Bu ffe r[],
ViPInt 32 nu mBy tes Re ad )
{
ViInt3 2 k, in de x;
ViCh ar Bu f[1 02 4];
ViSta tu s ATC_ sta tus = VI_ SUCCESS;
ViInt3 2 comma = 0 , b uffe r_ nu m = 0 ;
lo ng de vic e = 0;
ViCh ar res ou rce Name [50 ] = "";
*n umByte sRe ad = 0 L;
mems et ( rea dBuf fer, 0x0 , s izeo f (r ea dBuffe r));
mems et ( tmp_ bu ffer, 0x 0, s ize of ( tmp _ bu ffer) );
mems et ( Bu ffer , 0x 0, s ize of (Bu ffe r));
mems et ( Bu ffer 1, 0 x0 , siz eo f (Buff er1 ));
mems et ( Bu ffer 2, 0 x0 , siz eo f (Buff er2 ));
mems et ( Bu ffer 3, 0 x0 , siz eo f (Buff er3 ));
mems et ( Bu ffer 4, 0 x0 , siz eo f (Buff er4 ));
mems et ( Bu ffer 5, 0 x0 , siz eo f (Buff er5 ));
mems et ( Bu ffer 6, 0 x0 , siz eo f (Buff er6 ));
mems et ( Bu ffer 7, 0 x0 , siz eo f (Buff er7 ));
mems et ( Bu ffer 8, 0 x0 , siz eo f (Buff er8 ));
mems et ( Bu ffer 9, 0 x0 , siz eo f (Buff er9 ));
mems et ( Bu ffer 10 , 0x 0, s ize of (Bu ffe r10 ));
mems et ( Bu ffer 11 , 0x 0, s ize of (Bu ffe r11 ));
mems et ( Bu ffer 12 , 0x 0, s ize of (Bu ffe r12 ));
mems et ( Bu ffer 13 , 0x 0, s ize of (Bu ffe r13 ));
mems et ( Bu ffer 14 , 0x 0, s ize of (Bu ffe r14 ));
mems et ( Bu ffer 15 , 0x 0, s ize of (Bu ffe r15 ));
mems et ( Bu ffer 16 , 0x 0, s ize of (Bu ffe r16 ));
mems et ( Bu ffer 17 , 0x 0, s ize of (Bu ffe r17 ));
mems et ( Bu ffer 18 , 0x 0, s ize of (Bu ffe r18 ));
mems et ( Bu ffer 19 , 0x 0, s ize of (Bu ffe r19 ));
if (( AT CGe n < = 0) | | ( AT CGe n > MAX_ SESSIONS))
AT C_ sta tus = ERR_PARAMETER1 ; // se t err or s tat us cod e
if ( (AT C_s tatu s = ATC_s es sio nIn foRe so urc e (AT CGe nSes sio n[(AT CGe n-1 )],
res ou rce Name) ) < 0)
r etu rn AT C_ sta tus ;
// c he ck for da ta in bu ffe r
if( is _b uff er_ oc cu pie d[d ev ice ] != 0 )
{
s trn cpy ( re ad Bu ffe r, sa ve d_ bu ffe r[de vic e], nu mb er By tes To Rea d-1 );
r ea dBuffe r[n umb erByte sT oRe ad -1] = 0 ;
* nu mBy tes Re ad = strle n( sav ed _b uf fer[d ev ice ] );
Cle arSto red Bu ffe r( ATCGen Se ss ion [(ATCGen -1 )] );
r etu rn 0 ;
}
// Ma ke su re t o wait the minimu m amou nt of ti me b etwee n c omma nd s
if (( AT C_st atu s = ATC_n xtCmdWa it (AT CGe nSes sio n[(AT CGe n-1 )])) < 0 )
r etu rn AT C_ sta tus ;
Содержание 138156
Страница 3: ......