.

meiSynqNetTiming

Declaration

 
long meiSynqNetTiming(MEISynqNet        synqNet,
                      MEISynqNetTiming  *timing);
  Required Header: stdmei.h

Description

meiSynqNetTiming returns the network timing values to the location pointed to by *timing for the current operating network. This method can only be called in MEISynqNetStatus.state >= MEISynqNetStateSYNQ.

 
synqNet handle to a valid SynqNet object.
*timing a pointer to a MEISynqNetTiming structure.
   
 
Return Values
MPIMessageOK  
MPIMessageARG_INVALID  

Sample Code


/*
This function allows you to calculate how much of your SynqNet cycle you are actually using. The Foreground Cycle is reading values from all the nodes, where the TX (transmit) is sending data to nodes, and commanding motion. The larger the TX Start means that the Transmiting is happening later in the SynqNet Cycle (increasing latency between reading values, and interpreting them). However it is crucial that the TX Cycle Start NEVER is lower than the Foreground Cycle legnth. Always leave a Buffer. */
long synqNetTimingStatistics(MPIControl control, MEISynqNet synqNet)
{ MEISynqNetTiming timingValues;
long returnValue; // Grab Timing Data & Calculate Positions
returnValue = meiControlStatisticsReset(meiObjects->MpiControl());
if(returnValue != MPIMessageOK){
return returnValue;
} returnValue = meiSynqNetTiming(meiObjects->MpiSynqNet(), &timingValues); if(returnValue != MPIMessageOK){
return returnValue;
} printf("Foreground Cycle Usage: %3.2lf%%\n", timingValues.calculationTime/SQcontrollerPeriod*100); printf("TX Start @ Cycle Percent: %3.2lf%%\n", timingValues.txTime);
printf("TX Cycle Usage: %3.2lf%%\n", timingValues.downstream.total/timingValues.controllerPeriod*100); return returnValue;
}

See Also

MEISynqNetTiming | MEISynqNetState

 

       Legal Notice  |  Tech Email  |  Feedback
      
Copyright ©
2001-2010 Motion Engineering