AdsSyncWriteControlReq

Changes the state of an ADS device.

object.AdsSyncWriteControlReq(
  ADSSTATE As Long,
  deviceState As Long,
  length As Long,
  pData As Integer
) As Long

Parameter

ADSSTATE

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

deviceState

[in] Reserved

length

[in] Length of the data in bytes

pData

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

Return parameter

See ADS error codes

Comments

As well as changing the ADS state, it is also possible to send data to the ADS device. Whether such data is evaluated, and how, depends on the individual ADS devices. The ADS devices supplied with TwinCAT (PLC, NC/NCI, camshaft controller, ...) do not evaluate such information. 

Example

Visual Basic sample: 'Detect/alter state change in TwinCAT Router and the PLC'