IF #state = 1 THEN
// 初始化测量参数
#currentAngle := 0.0;
#outerPointCounter := 0;
#wallPointCounter := 0;
#outerRecordStart := FALSE;
#wallRecordStart := FALSE;
CASE #mode OF
1: // 外径测量模式
#angleStep1 := 360.0 / INT_TO_REAL(#outerDiameterPoints);
#rotationAngle := #angleStep1;
#outerPointCounter := 1;
#Rotate_axisStart_1[0] := TRUE;
2: // 壁厚测量模式
#angleStep2 := 360.0 / INT_TO_REAL(#wallThicknessPoints);
#rotationAngle := #angleStep2;
#wallPointCounter := 1;
#Rotate_axisStart_1[1] := TRUE;
3: // 混合测量模式
#angleStep1 := 360.0 / INT_TO_REAL(#outerDiameterPoints);
#angleStep2 := 360.0 / INT_TO_REAL(#wallThicknessPoints);
// 确定最大和最小步长
IF #angleStep1 >= #angleStep2 THEN
#maxStep := #angleStep1;
#minStep := #angleStep2;
ELSE
#maxStep := #angleStep2;
#minStep := #angleStep1;
END_IF;
// 计算步长比例
#ratio := DINT_TO_INT(TRUNC(#maxStep / #minStep + 0.5));
#remainder := #maxStep - #ratio * #minStep;
#rotationAngle := #minStep;
#currentStep := 1;
#totalSteps := #outerDiameterPoints * #wallThicknessPoints;
#Rotate_axisStart_1[2] := TRUE;
#i := 0;
FOR #i := 0 TO 4 DO
#Rotate_axisStart:= #Rotate_axisStart_1[#i] // Statement section FOR
;
END_FOR;
END_CASE;
#state := 2;
END_IF;
哪位大神帮忙看一下这个语句应用是否有问题?调试的时候,程序总是无法正常执行