Programming Reference | ADS Communication 12.9.5.3 AdsReadStateRes | AdsReadStateRes The method AdsWriteRes enables the sending of an ADS state read response. AdsReadStateCon [ } 199] forms the counterpart and is subsequently called. Syntax int AdsReadStateRes( AmsAddr& rAddr, ULONG invokeId, ULONG nResult, USHORT adsState, USHORT deviceState ); Return value Type: int Error code - see AdsStatuscodes [ } 323] . Parameter 12.9.5.4 AdsReadStateCon | AdsReadStateCon The AdsWriteCon method enables the receipt of an ADS state read confirmation. The receiving module must provide this method. AdsReadStateReq [ } 198] is the counterpart and must be called beforehand.
Syntax void AdsReadStateCon( AmsAddr& rAddr, ULONG invokeId, ULONG nResult, USHORT adsState, USHORT deviceState ); Return value void Parameter TwinCAT 3 199 Version: 1.19.1 Name Type Description rAddr AmsAddr& [in] Structure with NetId and port number of the responding ADS server. invokeId ULONG [in] Handle of the command, which was sent. The InvokeId is specified by the source device and is used for the identification of the commands. nResult ULONG [in] contains the result of the ADS write command; see AdsStatuscodes [} 323]. adsState USHORT [in] contains the ADS state of the device. deviceState USHORT [in] contains the device state of the device.
Name Type Description rAddr AmsAddr& [in] Structure with NetId and port number of the responding ADS server. invokeId ULONG [in] Handle of the command, which was sent. The InvokeId is specified by the source device and is used for the identification of the commands. nResult ULONG [in] contains the result of the ADS write command; see AdsStatuscodes [} 323]. adsState USHORT [in] contains the ADS state of the device. deviceState USHORT [in] contains the device state of the device.