External variables (V.E) (#INIT V.E.)
The command "V.E. ...." writes to external addresses in the NC program and/or reads from external addresses. This is permitted by direct memory-linked communication between the NC channel and external users, typically the PLC.
Access from the NC channel can be executed synchronously by the interpolator or asynchronously by the decoder.
![]() | Reading a synchronous V.E. variable causes the NC channel to be flushed. This is not permitted when TRC, polynomial contouring or HSC mode are active. |
For more information on configuration and parameterisation, see the descriptions of external variables in the documentation [8].
Programming Example
After controller start-up, the configured V.E. variables are initialised with zero.
Then V.E. variables can be re-initialised in the NC program using the #INIT command. The command can be followed by one or several V.E. variables which are initialised completely. Besides individual V.E. variables, complete V.E. arrays, V.E. structures and subelements of V.E. structures can also be initialised.
Syntax: |
#INIT V.E.<name> {, V.E.<name>} |
Notice | |
Access rights: If a variable only has read access rights, it cannot be initialised with the #INIT command. The same applies to V.E. structures if they contain at least one subelement that can only be read. |
Notice | |
Synchronous V.E. variables: As soon as a V.E. structure contains one synchronous variable, the entire initialization operation with #INIT is synchronous, i.e. it is only executed in the interpolator context. Therefore, possible asynchronous subelements are also affected by this operation because they may not yet be reinitialised by a subsequent read access. To achieve complete synchronism in these cases, users should therefore manually program a #FLUSH WAIT command before the #INIT command. Tip: When the #INIT command is used, it is recommended to create V.E. structure variables so that all elements are completely synchronous or completely asynchronous. |