beautypg.com

PNI TCM User Manual

Page 77

background image

PNI Sensor Corporation

DOC#1014688 r06

TCM User Manual

– July 2013

Page 72

pk t [ 2] = CommPr ot ocol : : kPi t ch;

pk t [ 3] = CommPr ot ocol : : kRol l ;

pk t [ 4] = CommPr ot ocol : : kTemper at ur e;

SendComm( CommPr ot ocol : : kSet Dat aComponent s, pkt ,

k Dat aCount + 1) ;

/ / Ti c ks i s a t i mer f unct i on. 1 t i ck = 10ms ec .

mTi me = Ti ck s( ) + 100;

/ / Tak i ng a sampl e i n 1s.

mSt ep++;

/ / go t o nex t st ep of pr ocess

br eak;

}


c ase 2:

{

/ / Ti c ks i s a t i mer f unct i on. 1 t i ck = 10ms ec .

i f ( Ti c ks ( ) > mTi me)

{

/ / t el l t he modul e t o t ak e a sampl e

SendComm( CommPr ot ocol : : kGet Dat a) ;

mTi me = Ti ck s( ) + 100; / / t ak e a sampl e ever y

s econd

mSt ep++;

}

br eak;

}

c ase 3:

{

/ / Ti c ks i s a t i mer f unct i on. 1 t i ck = 10ms ec .

i f ( Ti c ks ( ) > mRespons eTi me)

{

Mess age( " No r esponse f r om t he modul e. Check

c onnec t i on and t r y agai n\ r \ n" ) ;

mSt ep = 0;

}

br eak;

}


def aul t :

br eak;

}

}