Programming example
Programing Example
Teach-in with 3 spheres
; touch probe activation
T1 D1
G53
; deactivation of the zero offset
G53
#VAR
; input parameters:
V.L.MeasDistZ = 40
V.L.NumberCS = 2
V.L.PrePosX2 = 40
V.L.PrePosY3 = 50
V.L.PrePosY2 = 40
V.L.PrePosX3 = 60
V.L.SphereDiameter = 20
; output variables:
V.CYC.SysRetX
V.CYC.SysRetY
V.CYC.SysRetZ
V.CYC.SysRetA
V.CYC.SysRetB
V.CYC.SysRetC
#ENDVAR
L CYCLE [NAME=SysMeasCs5.ecy @P6 = V.L.MeasDistZ @P39 = V.L.NumberCS \
@P41=V.L.PrePosX2 @P42=V.L.PrePosX3 \
@P43 = V.L.PrePosY2 @P44=V.L.PrePosY3 \
@P87 = V.L.SphereDiameter ]
; print result
#FILE NAME [MSG="SysMeaCsResult.txt"]
#MSG SAVE ["V.CYC.SysRetX =%f", V.CYC.SysRetX]
#MSG SAVE ["V.CYC.SysRetY =%f", V.CYC.SysRetY]
#MSG SAVE ["V.CYC.SysRetZ =%f", V.CYC.SysRetZ]
#MSG SAVE ["V.CYC.SysRetA =%f", V.CYC.SysRetA]
#MSG SAVE ["V.CYC.SysRetB =%f", V.CYC.SysRetB]
#MSG SAVE ["V.CYC.SysRetC =%f", V.CYC.SysRetC]
; calling the #CS by the subroutine written in the cycle
L CS_BASE_2.bcs
; ... machining workpiece with measured coordinate system ....
#CS OFF
M30
Example of a program generated:
%CS_BASE_2.bcs
#COMMENT BEGIN
CS X = 1430
CS Y = -35
CS Z = 734,992
CS A = 0
CS B = 0
CS C = -0.0222
#COMMENT END
#CS DEF [2][1430,-35,734.992,0,0,0]
#CS ON [2]
M17
Another example for handling SysMeasCs cycles is contained in the Overview section in the subsection Programming.