'Macro M1000 'RESOURCES:*******************************'**********UserLED's**********************ManualPartcntOVR = GetUserLED(1500) 	'Over ride Part program with user selected number of parts.'*****************************************'**********UserParameter from program*****Program = GetVar(1)			'Part count How many Repeats of this part to do from Gcode.'*****************************************'**********UserVar's control**************InitVar = GetVar(100)			'sets Initial counter and lockoutInitControl =GetVar(101)		'Set init lockout control'*****************************************If ManualPartcntOVR = 0 ThenSetUserDRO(1500,Program)		'Set Total parts from programElse					'Set total number wanted from Manual OverRideManual = GetUserDRO(1500)  		'Part count How many TO run DRO Total number set by Prog, or manualEnd IfIf InitVar=0 ThenSetUserDRO(1501,0)			'Zero the parts that have run DROSetVar(100,1)				'Set InitVar to 1, to lock this code out this runEnd If'*********UserDRO's***********************Total = GetUserDRO(1500)Completed = GetUserDRO(1501)  		'Part count How many parts completed DRO'*****************************************Remain = (Total-Completed)If InitVar = 1 And InitControl = 1 Then	If Remain = 0 Then	Call SetTicker(1,"        All parts are finished")	SetUserDRO(1500,0)	SetUserDRO(1501,0)	DoOEMButton(1003)		'Stop the Machine	While IsMoving()	Wend	End IfSetVar(100,0)SetVar(101,0)End If'******************************************************************************   