FindCld function
Use the <FindCld> function to locate command named <CmdName> in the current CLData file. <StartIndex> parameter defines the first scanned command. <StartIndex> is relative to the first command in the current CLData file. If <StartIndex> parameter is omitted, then operator will scan commands starting with the command immediately following the current. The returned value is the index of the found command. When no command was found operator returns -1. The <Data> parameter must be a declared array of real. <Data> will receive the values from the found command's CLData array. Syntax:
N = FindCld({<StartIndex>, }<CmdName>, <Data>)
For example, suppose the following CLDATA and suppose the current command number is 0.
0: PARTNO "Bottle"
1: PPFUN …..
2: COMMENT "Roughing Waterline"
3: LOADTL N 2,X 0,Y 0,Z 0,D 8….
4: SPINDL ON(71),NO 397.887,K 0,MODE RPM(0)
5: CUTCOM ON(71),LENGTH(9) 2,X 0,Y 0,Z 0,N 0,K 0,M 0,LEFT(8)
6: RAPID N 10000
7: GOTO.abs X 134.533,Y 99.684,Z 80
8: RAPID N 10000
<PartNo> program is the following:
program PartNo
V: Array of Real
NCircle: Integer
NGoto: Integer
NCircle = FindCld("CIRCLE", V)
NGoto = FindCld("GOTO.abs", V)
if NGoto > NCircle then
Print "The first movement is an arc"
else
Print "The first movement a cut"
End
In result of program execution the message "The first movement a cut" will be print out.
To get access to the parameters of arbitrary technological command can also use the CLDFile operator.
See also:
CLData functions and operators