AdsAmsPortEnabled
This method can be used to determine whether the AMS port is available for communication.
object.AdsAmsPortEnabled() As Boolean
Parameter
-
Return value
-
Comments
-
Example
The following sample illustrates a function in which messages are written to the Windows NT/2000/XP Event Viewer. The method AdsLogFmtString() is used for this. Since the access to the Event Viewer is made via the TwinCAT Router, the method should only be used if the AMS port is active.
'Meldungen über ADS in die Ereignisanzeige schreiben
Public Function LogMsg (MsgType As ADSLOGMSGTYPE, MsgStr As String)
If (AdsOcx.AdsAmsPortEnabled = True) Then
MsgStr = Left(MsgStr, 250)
Call AdsOcx.AdsLogFmtString(MsgType, MsgStr, 0, 0, 0, 0)
End If
End Function