AdsMgGetCommStats
Returns server communication statistics.
Syntax
UNSIGNED32 AdsMgGetCommStats(ADSHANDLE hMg, void* pInfo,
UNSIGNED16* pusSize);
Parameters
Parameter
Type
Description
hMg
ADSHANDLE
Management connection handle.
pInfo
void*
Pointer to the output ADS_MGMT_COMM_STATS structure.
pusSize
UNSIGNED16*
Structure size (input) and bytes written (output).
Return Value
AE_SUCCESS (0) on success. Error code on failure.
Description
AdsMgGetCommStats returns server communication statistics, including checksum percentage, total packets, out-of-sequence packets, checksum failures, and send/receive errors.
Example
ADS_MGMT_COMM_STATS stStats;
memset(&stStats, 0, sizeof(stStats));
UNSIGNED16 usSize = sizeof(stStats);
AdsMgGetCommStats(hMgmt, &stStats, &usSize);
printf("Total packets: %lu\n", stStats.ulTotalPackets);