AdsEnableLogNotification

Sets the filter for the reception of messages via the TwinCAT Router. 

object.AdsEnableLogNotification(
  nBasePort As Long,
  nPorts As Long,
  dwCtrlMask As Long
) As Long

Parameter

nBasePort

[in] First port number for which the AdsLogNotification() event is triggered

nPorts

[in] Number of ports starting from nBasePort for which the AdsLogNotification() event is triggered

dwCtrlMask

[in] Filter mask for the kinds of messages that are to be reported (see ADSLOGMSGTYPE data type)

Return value

See ADS error codes

Comments

ADS devices are able to send messages to other ADS devices via the TwinCAT Router. Before an ADS device is able to receive messages with the aid of the ADS-OCX, the AdsEnableLogNotification() method must be used to define a filter. This defines which messages are to be reported.

One of a filter's functions is to define a range of port numbers. All the messages from the ADS devices that lie within this range of port numbers will be reported by the AdsLogNotification() event.

The second parameter with which messages can be filtered is the message type. A distinction is made between note, warning and error (see ADSLOGMSGTYPE). Various other types of message can be received by using a OR combination.

Example

Visual Basic sample: 'Send/receive messages via the TwinCAT Router'