PNI Sensor Corporation DOC#1014688 r06
TCM User Manual – July 2013 Page 72
pkt [ 2] = CommPr ot ocol : : kPi t ch;
pkt [ 3] = CommPr ot ocol : : kRol l ;
pkt [ 4] = CommPr ot ocol : : kTemper at ur e;
SendComm( CommPr ot ocol : : kSet Dat aComponent s, pkt ,
kDat aCount + 1) ;
/ / Ti cks i s a t i mer f unct i on. 1 t i ck = 10msec.
mTi me = Ti cks( ) + 100;
/ / Taki ng a sampl e i n 1s.
mSt ep++;
/ / go t o next st ep of pr ocess
br eak;
}
case 2:
{
/ / Ti cks i s a t i mer f unct i on. 1 t i ck = 10msec.
i f ( Ti cks( ) > mTi me)
{
/ / t el l t he modul e t o t ake a sampl e
SendComm( CommPr ot ocol : : kGet Dat a) ;
mTi me = Ti cks( ) + 100; / / t ake a sampl e ever y
second
mSt ep++;
}
br eak;
}
case 3:
{
/ / Ti cks i s a t i mer f unct i on. 1 t i ck = 10msec.
i f ( Ti cks( ) > mResponseTi me)
{
Message( " No r esponse f r om t he modul e. Check
connect i on and t r y agai n\ r \ n" );
mSt ep = 0;
}
br eak;
}
def aul t :
br eak;
}
}
Comentarios a estos manuales