AdsEnumSymbols
The list of declared variables can be read from an ADS device with this method.
object.AdsEnumSymbols(
strSymbolName As String,
nSymbolType As Long,
cbSymbolSize As Long,
strComment As String,
nIndexGroup As Long,
nIndexOffset As Long,
bNextAs Boolean
) As Long
Parameter
strSymbolName
[out] Name of the ADS variable
nSymbolType
[out] Data type of the ADS variable (see the ADSDATATYPEID data type)
cbSymbolSize
[out] Data length of the ADS variable in bytes
strComment
[out] Comment following the ADS variable declaration
nIndexGroup
[out] Index group of the ADS variable
nIndexOffset
[out] Index offset of the ADS variable
bNext
[in] TRUE for the first ADS variable, FALSE for all those which follow
Return value
See ADS error codes
Comments
When the AdsEnumSymbols() method is first called, you must set the bNext parameter to FALSE. This causes all the information about the first variable to be read. Every time AdsEnumSymbols() is called after this, the parameter must be TRUE. This causes the information about the following variable to be read.
Note on PLC: Ensure that 'Symbol download' is enabled in PLC Control under Project / Options / TwinCAT. You will find more detailed information in the PLC Control manual.
Note on NC: Symbol download must be enabled for each axis in the System Manager. This can be specified in the configuration dialog for the axis under 'General'. The 'Create symbols' box must be checked. See System Manager manual.