AdsReadSymbolDesc
The AdsReadSymbolDesc() method can be used to obtain information about the individual symbols (variables) in ADS devices.
object.AdsReadSymbolDesc(
strSymbolName As String,
nSymbolType As ADSDATATYPEID,
cbSymbolSize As Long,
strComment As String,
nIndexGroup As Long,
nIndexOffset As Long
) As Long
Parameter
strSymbolName
[in] Name of ADS variable from which the information is to be read
nSymbolType
[out] Data type of the ADS variable (see the ADSDATATYPID 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
Return value
See ADS error codes
Comments
If you wish to read the information for all the ADS variables from a ADS device, you will find a relevant sample under 'Read PLC variable declaration'.
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
-