Cycle variables (V.CYC.)
Release Note
This function is available as of CNC Build V2.11.2032.08
Notice
A precondition for using V.CYC. variables is that memory space must be reserved via the channel parameter P-CHAN-00418.
The identifier "V.CYC. ..." addresses self-defined variables that must be used by preference within cycle programs. In addition, V.CYC. variables can also be used in standard main programs and subroutines. Besides specifying the variable name, the statement also includes a definition of the data type. The variables are valid as from their declaration in the current program level and in all other directly called program levels ( subroutines). They are deleted when the program level in which they were created is left (return) (see Validity and visibility).
V.CYC. variables also have the option of creating multi-dimensional arrays. A maximum of 4 dimensions is possible, e.g. V.CYC.Test[1][2][3][4].
Syntax: | |
V.CYC.<FREE_DEF> | Cycle/program-specific variable |
<FREE_DEF> | User-defined name consisting of any number of characters (excluding blanks, tabulators, comments, comparison operators, mathematical operators, square brackets). |
Example
V.CYC statement
%CYCLE_TEST.cyc
P1 = 3 ;first index of the array
P2 = 2 ;second index of the array
P3 = 10 ;default maximum string length
#VAR
V.CYC.TEST_A[P1][P2] : STRING[P3]
V.CYC.TEST_B : STRING[P3] = "TEXT"
V.CYC.TEST_C : REAL64 = 1.0
#ENDVAR
:
M30