V.CYC variables

Release Note

release_note

This function is available as of CNC Build V2.11.2032.08

Notice

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 within cycle programs. Besides specifying the variable name, the statement also includes a definition of the data type. The variables are valid in the form of subroutines as of their statement in the current cycle and in all other cycle levels which are directly called. They are deleted when the cycle level in which they were created is exited (return) (see Validity and visibility).

Any V.CYC. variable can be initialised with a value in the statement. The variable is assigned the initial value of each data type without assigning an initial value.

V.CYC. variables also have the option of creating 2-dimensional arrays.

Notice

notice

V.CYC variables must be declared in a #VAR / #ENDVAR block.

Example

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