[REMAP FOR M6] Why does linuxcnc run the .ngc file on startup?

More
5 years 2 months ago #219011 by bevins

Hi,
but i use to .ngc file...
Code:
REMAP=M6 modalgroup=6 prolog=change_prolog ngc=tool_change epilog=change_epilogWhere should I add the part you mentioned? [code]if self.task==0:      return INTERP_OK  
[/code]
The way to address this issue is to test in your procedure whether it executes in preview or execution mode. This can be checked for by testing the 
Code:
#<_task>
  predefined named parameter  - it will be 1 during actual execution and 0 during preview. See configs/sim/axis/remap/manual-toolchange-with-tool-length-switch/nc_subroutines/manual_change.ngc for a complete usage example.Within Embedded Python, the task instance can be checked for by testing self.task - this will be 1 in the milltask instance, and 0 in the preview instance(s).

Please Log in to join the conversation.

More
5 years 2 months ago #219012 by bevins
if [[#<_task> GT 0]

This should be true if it is in milltask. Maybe check if it is less than 1 (preview mode), then exit. I think thats how its done in ngc remap.
Something like that. Not 100% sure as I have not done an NGC remap, I only have done python remaps.

Please Log in to join the conversation.

More
5 years 2 months ago #219013 by Aciera
Ok, I can confirm on a simulation config that the code in a M6 ngc remap is executed at start up.


[edit] Just learned something. Thanks bevins.

o<tool_change > sub

o100 if [#<_task> GT 0]
         ; code here
o100 endif

o<tool_change> endsub
m2

Please Log in to join the conversation.

More
5 years 2 months ago #219014 by mugurlu
this is how it works, we now prevent it from running directly on boot
thank you  bevins  
Code:
o<tool_change> sub O300 if [#<_task> EQ 0] O300 else     (print, rack_change: loaded tool=#<_current_tool> current pocket: #<_current_pocket>)     (print, rack_change: selected tool=#<_selected_tool> selected pocket: #<_selected_pocket>)     M68 E0 Q#<_selected_tool> ;Set target tool number     M64 P0 ;Enable tool changer          G4 P0.5          M66 P0 L3 Q10; wait for carousel-locked = false         o202 if [#5399 EQ 0]             M65 P0 ;Disable tool changer             (abort, carousel still locked hello)         o202 endif              M65 P0 ;Disable tool changer          G43 H#<_selected_tool>          (print,mcode end) O300 endif o<tool_change> endsub [1] M2

Please Log in to join the conversation.

More
5 years 2 months ago #219020 by bevins
I really need to challenge my fear of an ngc remap and just do one....

Please Log in to join the conversation.

Time to create page: 0.085 seconds
Powered by Kunena Forum