AdsCreateVarHandle
Generates a unique handle for an ADS variable.
object.AdsCreateVarHandle(
varName As String,
hVar As Long
) As LongParameter
varName
[in] Name of the ADS variable
hVar
[out] Handle of the ADS variable
Return value
See ADS error codes
Comments on the PLC:
![]() | Enable Symbol download Ensure that 'Symbol download' is enabled in PLC Control under Project / Options / TwinCAT. You will find more detailed information in the PLC Control manual. |
The method's first parameter is composed of the POE name and the PLC variable that is to be addressed. If, for instance, the variable 'SPSVar1' from the function 'Funk1' is to be accessed, then 'Funk1.SPSVar1' must be supplied as the first parameter. When global variables are being accessed, the POE name is omitted, as, for instance, in '.SPSGlobVar'. The parameter 'varName' does not distinguish between upper and lower case letters. If only certain specific PLC variables are required in a form, the handle should only be created when the form is loaded, and should be released again when the form is closed. See also the AdsCreateVarHandle() method.
Comments on the NC:
Notice | |
Enable Symbol download at each axis 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. |
The symbolic names of the individual NC parameters have a fixed specification, and can be found in the NC documentation.
Example
-
