CLD predefined array
The array <CLD> is an array of real numbers. It is designed to store numerical parameters of currently executing technological CLData command. Before calling the handler of the current command its parameters are filled in this array. Inside the handler command parameters can be analyzed by accessing individual array elements and on the basis of analysis can be generated blocks of the NC-program.
Command parameters are accessed either by indexing the appropriate item in the <CLD> array or by unique parameter name.
To access by index use the common array syntax: <CLD[i]> – i-th array item – real number, <i> – item index – positive integer. Index of array element can be a variable or an expression of integer type. For example: <CLD[3]>, <CLD[n]>, <CLD[2*n+1]> etc. The total number of elements in the array < CLD > contained in the predefined variable < RecNum >.
To access parameters by name use the following syntax: <CLD.Parameter name>, where <Parameter name> – unique identifier of the parameter. For example, <CLD.X>, <CLD.Mode> and so on. Parameter names are specific for each command. The detailed description of CLData technology commands and their parameters is found in the appendix. Also you can see the list of parameters at the <Current parameters> panel of the <Mask> page of the main window and on the <CLData> tab at the bottom of the main window .
Example of using < CLD > array
program Circle
if CLD.R > 0 then INTERP_ = 3
else INTERP_ = 2 ! G3/G2
X = cld[5]
Y = cld[6]
Z = cld[7]
I = CLD.Xc
J = CLD.Yc
R = abs(cld.R)
OutBlock
end
The above CIRCLE command handler outputs into NC-code blocks of moving in a circle G2 or G3 (clockwise or counterclockwise) with the endpoint (X, Y, Z), center (I, J) and radius (R) .
Access to the parameters of CLData command, including and not numeric, can also be obtained by the operator Cmd .
See also:
CLData functions and operators