AdsReadSymbolInfo

The AdsReadSymbolInfo() method can be used to obtain information about the symbols (variables) in ADS devices.

object.AdsReadSymbolInfo(
  pSymbolsAvailable As Long,
  pBufSizeNeeded As Long
) As Long

Parameter

pSymbolsAvailable

[out] Number of symbols in the ADS device

pBufSizeNeeded

[out] Length of the data, in bytes, in which the symbol information is to be stored

Return value

See ADS error codes

Comments

Before the AdsEnumSymbols() method can be used to read the symbol list, the method AdsReadSymbolInfo() must be used to find the number of symbols and the size of the symbol list.

Note on PLC: Ensure that 'Symbol download' is enabled in PLC Control under Project / Options / TwinCAT. More detailed information can be found in the PLC Control manual.
Note on NC: In the System Manager the symbol download must be enabled for each axis. This can be specified in the configuration dialog for the axis under 'General'. The 'Create symbols' box must be checked. See System Manager manual.

Example

Visual Basic sample: 'Read PLC variable declaration'