beckhoff TwinCAT 3 — 12.9.2.1 AdsReadReq

Programming Reference | ADS Communication 12.9.1.4 AdsReadDeviceInfoCon | AdsReadDeviceInfoCon The AdsReadDeviceInfoCon method enables the receipt of an ADS read confirmation of device information. The receiving module must provide this method. The counterpart AdsReadDeviceInfoReq [ } 190] must be called beforehand. Syntax void AdsReadDeviceInfoCon( AmsAddr& rAddr, ULONG invokeId, ULONG nResult, CHAR name[ADS_FIXEDNAMESIZE], AdsVersion version ); Return value void Parameter 12.9.2 AdsRead | AdsRead 12.9.2.1 AdsReadReq | AdsReadReq The AdsReadReq method enables the sending of an ADS read command for the data transmission from an ADS device.

AdsReadCon [ } 194] is called on receipt of the response. Syntax int AdsReadReq( AmsAddr& rAddr, ULONG invokeId, ULONG indexGroup, ULONG indexOffset, ULONG cbLength ); Return value Type: int Error code - see AdsStatuscodes [ } 323] . Parameter TwinCAT 3 192 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].

name char[ADS FIXEDNAMESIZE] _ [in] contains the name of the device. version AdsVersion [in] structure of build (int), revision (byte) and version (byte) of the device. Name Type Description rAddr AmsAddr& [in] Structure with NetId and port number of the 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. indexGroup ULONG [in] Contains the index group number (32-bit, unsigned) of the requested ADS service. indexOffset ULONG [in] Contains the index offset number (32-bit, unsigned) of the requested ADS service.