C++-samples | Sample03: C++ as ADS server Description This client performs two tasks: Testing the ADS-server, which was described before. Providing sample code for implementing a ADS-client Using the client Selecting a communication partner Enter both ADS parameters in order to specify your ADS communication partner: NetID: 127.0.0.1.1.1 (for ADS partners also connected to local ADS Message Router) Enter a different NetID if you want to communicate via the network with an ADS partner connected to another ADS router. You must first establish an ADS route between your device and the remote device once. AdsPort Enter the AdsServerPort of your communication partner.
Do not confuse the ADS server port (which has explicitly implemented your own message handler) with the regular ADS port for the purpose of accessing symbols (this is provided automatically, without the need for user intervention). Find the assigned AdsPort [ } 238] , in this sample the AdsPort was 0x8235 (dec 33333). Create link with communication partner Click on Connect to call the method TcAdsClient.Connect for the purpose of creating a link with the configured port. The Start / Read / Stop / Overwrite / Reset buttons are used to send ADS messages to the ADS server. The specific indexGroup / indexOffset commands have already been designed in the ADS interface of the ADS server [ } 238] .
The result of clicking on the command buttons can also be seen in the module instance in the Parameters (online) tab. TwinCAT 3 243 Version: 1.19.1