Promotic
WikipediaLinkedInYoutubeTwitterFacebook

GetCount - method of object PmCommMsg

Description:
Getting the number of transmissions of this object
Syntax:
GetCount(nType As Long) As Long
Calling:
n = oCommMsg.GetCount(nType)
Parameters:
nType(Long) Specification of transmissions whose number we want to get:
0 - Total number of all transmissions (successul and failed) in this object since application launch (sum of types 1 and 2)
1 - Total number of all successful transmissions in this object since application launch
2 - Number of all failed transmissions in this object since application launch
3 - Number of latest failed transmissions in this object. This number is set to 0 after every successful transmission.
Note:
By the term "transmission" is here understood the action that is finally terminated by the onEndOfTransfer event. If the configurator Number of repeats after unsuccessful transmission is greater than 1 in the serial link parameters (or in the Ethernet parameters), then the message is repeated more times after an error but from the point of this statistics it is just 1 transmission.

If the parameter pEvent.Error = 0 in the onEndOfTransfer event, then it is "successful transmission" elsewhere it is "failed transmission".

Example:
If communication error appears 5 times in a row in this object, then notify (e.g. call the alarm, etc.)
If oCommMsg.GetCount(3) > 5 Then
   '... The action for warning the non-functional communication
End If
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice