beckhoff TwinCAT 3 — 12.9.4.2 AdsReadWriteInd

Programming Reference | ADS Communication Syntax void AdsWriteCon( AmsAddr& rAddr, ULONG invokeId, ULONG nResult ); Return value void Parameter 12.9.4 AdsReadWrite | AdsReadWrite 12.9.4.1 AdsReadWriteReq | AdsReadWriteReq The AdsReadWriteReq method enables an ADS read/write command to be sent for data transmission to and from an ADS device. The AdsReadWriteCon [ } 197] is called when the response is received. Syntax int AdsReadWriteReq( AmsAddr& rAddr, ULONG invokeId, ULONG indexGroup, ULONG indexOffset, ULONG cbReadLength, ULONG cbWriteLength, PVOID pData ); Return value Type: int Error code - see AdsStatuscodes [ } 323] .

Parameter 12.9.4.2 AdsReadWriteInd | AdsReadWriteInd The AdsReadWriteInd method specifies an ADS read/write command to transfer data to an ADS device. The AdsReadWriteRes [ } 199] must be called in order to send the result. Syntax void AdsReadWriteInd( AmsAddr& rAddr, ULONG invokeId, ULONG indexGroup, ULONG indexOffset, ULONG cbReadLength, ULONG cbWriteLength, PVOID pData ); TwinCAT 3 196 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 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. cbReadLength ULONG [in] contains the length in bytes of the data to be read (pData).

cbWriteLength ULONG [in] contains the length in bytes of the data to be written (pData). pData PVOID [in] pointer to the data buffer in which the written data are located.