21 Appendix
173 MY50STS=2 'Tracking possible
174 Else 'If tracking not possible
175 If PX50CUR.Y>0 Then MY50STS=1 'Wait
176 If PX50CUR.Y<0 Then MY50STS=3 'Move onto the next workpiece
177 If PosCq(PX50CUR)=0 And PX50CUR.Y<=M50STT And PX50CUR.Y>=M50END Then
MY50STS=3 'Outside the movement range
178 EndIf
179 Break
180 Case 3 'Left side rear -> front
181 Case 5 'Right side rear -> front
182 M50STT=-MX50ST 'The start side has a negative value
183 M50END=MX50ED
184 If PosCq(PX50CUR)=1 And PX50CUR.X>=M50STT And PX50CUR.X<=M50END Then
185 MY50STS=2 'Tracking possible
186 Else 'If tracking not possible
187 If PX50CUR.X<0 Then MY50STS=1 'Wait
188 If PX50CUR.X>0 Then MY50STS=3 'Move onto the next workpiece
189 If PosCq(PX50CUR)=0 And PX50CUR.X>=M50STT And PX50CUR.X<=M50END Then
MY50STS=3 'Outside the movement range
190 EndIf
191 Break
192 Case 4 'Left side front -> rear
193 Case 6 'Right side front -> rear
194 M50STT=MX50ST
195 M50END=-MX50ED 'The end side has a negative value
196 If PosCq(PX50CUR)=1 And PX50CUR.X<=M50STT And PX50CUR.X>=M50END Then
197 MY50STS=2 'Tracking possible
198 Else 'If tracking not possible
199 If PX50CUR.X>0 Then MY50STS=1 'Wait
200 If PX50CUR.X<0 Then MY50STS=3 'Move onto the next workpiece
201 If PosCq(PX50CUR)=0 And PX50CUR.X<=M50STT And PX50CUR.X>=M50END Then
MY50STS=3 'Outside the movement range
202 EndIf
203 Break
204 End Select
205 If MY50STS=0 Then Error 9199 'Program modification required
206 Return
207 '
208 '### Origin return processing ###
209 *S90HOME
210 Servo On 'Servo ON
211 P90CURR=P_Fbc(1) 'Acquire the current position
212 If P90CURR.Z<P1.Z Then 'If the current height is below the origin
213 Ovrd 10
214 P90ESC=P90CURR 'Create an escape position
215 P90ESC.Z=P1.Z
216 Mvs P90ESC 'Move to the escape position
217 Ovrd 100
218 EndIf
219 Mov P1 'Move to the origin
220 Return
221 '
222 '### Tracking interruption processing ###
223 *S91STOP
224 Act 1=0
225 Trk Off
226 GoSub *S86OPEN 'Release suction
227 P91P=P_Fbc(1) 'Acquire the current position
228 P91P.Z=P1.Z
229 Mvs P91P Type 0,0 'Raise
21-130 Sample Programs