Beckhoff Automation GmbH & Co. KG TwinCAT 2 | ADS-Script-DLL — 3.1.3 WriteAdsState

API Examples VBScript: Dim TcClientSync Set TcClientSync = CreateObject("TCSCRIPT.TcScriptSync") Call TcClientSync.ConnectTo("", 801) JScript: var TcClientSync; TcClientSync = new ActiveXObject("TCSCRIPT.TcScriptSync"); TcClientSync.ConnectTo("172.16.17.13.1.1", 811); 3.1.2 ReadAdsState Reads the current ADS state of an ADS device. object.ReadAdsState() As Long Parameters - Return value ADS-Status. Description Any ADS device can adopt several states. The PLC, for instance, can be in either the STOP or the RUN state. This state can be interrogated with the aid of the ReadAdsState() method.

A summary of all the possible states is found, for instance, in the description of the ADSSTATE enum of the ADS-OCX. When evaluating the ADS state, it must be remembered that not every ADS device can adopt every state. The NC, for instance, cannot be in the STOP state. The most important of the ADS states are RUN (5) and STOP (6), and they are used most often in connection with the PLC. Examples VBScript: Dim nAdsState nAdsState = TcClientSync.ReadAdsState() WScript.echo "AdsState = ", nAdsState JScript: var nAdsState; nAdsState = TcClientSync.ReadAdsState(); WScript.echo("AdsState = ", nAdsState); 3.1.3 WriteAdsState Changes the ADS state of an ADS device.

object.WriteAdsState(nAdsState As Long) Parameters TX1000 11 Version: 1.0 nAdsState new ADS status.