vsTASKER 7 Tutorial
×
Menu
Index

Sub-banding

 
Quite often, inside a component runtime, some checks do not need to be carried out at the component base rate. For example, checking the temperature of an engine component running at 30hz can be done every second or two.
 
A sub-band can only by a division of the base component frequency. If the component is running at 30hz, a sub-band can run at 15hz or 7hz, etc
 
The following example shows how to call a function, from the Runtime part of the component, at 2hz.
 
Declaration:
  double sb_check;  // to be set to 0 in the INIT part
 
Runtime:
  sb_check += cycleT();  // cycleT() = theoritical time in second between two calls of the component runtime
  if (_check > 0.5) { doSomething(); sb_check = 0; }   // 0.5 = 1/2 = 2hz