; copy von haberler examples ;2014.01.05 V1.00 TK First version to get Z Axis and Arm in ;2014.02.15 V1.00B TK Eigentlicher umbau für Componente ;2014.03.23 V2.00 TK Umbau für Komponente nccarousel.comp 1.05b 27.3 ;2014.04.20 V2.01 TK Anpassung Errohandling und Move für BP412! https://www.youtube.com/watch?v=MdlIe_ExkI4 ;2014.08.09 V2.02 TK Anpassung Armmove und Zeit o sub o100 if [#<_current_tool> EQ #<_selected_tool>] (print, current_tool = selected no action ) ; succeed by returning a positive value o endsub [1] o100 endif ;------------Normalfall change weitermachen M73 (auto-restore modal settings on return) ; (print, rack_change: loaded tool=#<_current_tool> current pocket: #<_current_pocket>) (print, rack_change: selected tool=#<_selected_tool> selected pocket: #<_selected_pocket>) ; get z Axis in Safe Haven M5; spindle stop o call ;here Spindel Orientation !!!! for now we dont care (print, Do M19 spindle orient here ) M19 R0 ; unload previous tool ; check if initialized ; unload previous tool ;------------carousel init zum testen---- ;o200 if [#<_current_pocket> EQ 0] ;(print, current_pocket = 0 bedeutet init Carousel! ) ;M68 E3 Q1 ;Qx = Pocket ;M64 P3 ; Jetzt drehen ;(print, o200 drehen) ;M66 P1 L3 Q10 ; Warte auf Digital in1 10Sek ;o200 endif ;------------Normalfall bei 2en Tool o300 if [#<_current_pocket> GT 0] ; We adjust Carousel to actual pocket => has to be empty (print, Unload old ->Carousel has to be at current Pocket) ; no we drive armm in has to be empty o call o call [#<_current_pocket>] M62 P #<_ini[pins]lock> ; set lock pin G4 P #<_ini[dwell]lock_time> ;Now Z axis high o call G4 P #<_ini[dwell]lock_time> ;orig nix gut o call o call ;orig G4 P #<_ini[dwell]mystery> ; unsure what this is for ;? G4 P #<_ini[dwell]mystery> ; unsure what this is for (print, Unload old Sucess) o300 endif ;---------------------------------------------- ;Now make Turn Carousel ----------------turn it (print,Turn carousel for new tool ) M68 E3 Q#<_selected_pocket> ;Qx = Pocket M64 P3 ; Jetzt drehen M66 P1 L3 Q16 ; Warte auf Digital in1 18Sek M65 P3 ; Jetzt nicht mehr drehen ; check motion.digital-in-01 = p1 ! o400 if [#<_hal[motion.digital-in-01]> GT 0] (print, NEU motion.digital-in-01 GT 0-> 5600 =0 ) #5600 = 0 ; go to new tool only if not danger o call o400 else (print, NEU motion.digital-in-01 LE 0 -> 5600 =-1 ) #5600 = -1 ; Brutales Ende o endsub [-1] o400endif M64 P #<_ini[pins]lock> ; set lock pin M64 P #<_ini[pins]flush> ; set flush pin G4 P #<_ini[dwell]new_tool> M65 P #<_ini[pins]flush> ; drop flush pin o call [#<_selected_pocket>] G4 P 10 M65 P #<_ini[pins]flush> ; drop flush pin G4 P #<_ini[dwell]post_unlock> M65 P #<_ini[pins]lock> ; set lock pin ; now remove magazin of spindle o call ; now Z axis away o call (print, ---------Finnish------------ ) (print,#<_selected_tool>) G43 H#<_selected_tool> ; succeed by returning a positive value o endsub [1] m2