mpiSynqNetTiming

Declaration

int32_t mpiSynqNetTiming(MPISynqNet        synqNet,
                      MPISynqNetTiming  *timing);

Required Header: stdmpi.h

Description

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

synqNet handle to a valid SynqNet object.
*timing a pointer to a MPISynqNetTiming 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. */ int32_t synqNetTimingStatistics(MPIControl control, MPISynqNet synqNet)
{ MPISynqNetTiming timingValues;
int32_t returnValue; // Grab Timing Data & Calculate Positions
returnValue = mpiControlStatisticsReset(mpiObjects->MpiControl());
if(returnValue != MPIMessageOK){
return returnValue;
} returnValue = mpiSynqNetTiming(mpiObjects->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

MPISynqNetTiming | MPISynqNetState