AdsWriteControlReq

Changes the ADS state and the device state of the ADS server.

object.AdsWriteControlReq(
  nInvokeId As Long,
  nAdsState As Long,
  nDeviceState As Long,
  cbLength As Long,
  pData As Integer
) As Long

Parameter

nInvokeId

[in] Job number for identification of the response

nAdsState

[in] New ADS state (see the ADSSTATE data type)

nDeviceState

[in] New device state

cbLength

[in] Length of the data in bytes

pData

[in] Visual Basic variable from which the data is written into the ADS variable

Return value

See ADS error codes

Comments

In addition to changing the ADS state and the device state, it is also possible to send data to the ADS server in order to transfer further information. For the current ADS devices (PLC, NC, ...) this data is not evaluated further.
Each ADS device can communicate its current state to other ADS devices. A distinction is made between the state of the device itself (DeviceState) and the state of the ADS interface of the ADS device (AdsState). The states that the ADS interface can adopt are laid down in the ADS specification.

Example

-