AdsSyncReadWriteReq

Writes data synchronously into an ADS server and receives data back from the ADS device.

LONG AdsSyncReadWriteReq(
  PAmsAddr  pAddr,
  ULONG     nIndexGroup,
  ULONG     nIndexOffset,
  ULONG     nReadLength,
  PVOID     pReadData,
  ULONG     nWriteLength,
  PVOID     pWriteData
);

Parameter

pAddr

[in] Structure with NetId and port number of the ADS server.

nIndexGroup

[in] Index Group.

nIndexOffset

[in] Index Offset.

nReadLength

[in] Length of the data, in bytes, returned by the ADS device.

pReadData

[out] Buffer with data returned by the ADS device.

nWriteLength

[in] Length of the data, in bytes, written to the ADS device.

pWriteData

[out] Buffer with data written to the ADS device.

Return value

Returns the function's error state.

Sample

See Sample 7: Accessing an array in the PLC