toolchange.ngc error calling subroutine

More
3 years 6 months ago #268125 by mloser
 I followed the toolchange.ngc example as best I could.  I have the errors all fixed as far as I can tell.I get the attached error message when I run the M6 command.  I attached the .hal and .ini filesalong with the toolchange.ngc file.  I have the PROGRAM_PREFIX and SUBROUTINE_PATH lines in the .ini file.

Thanks,
Mike 

 

Attachment not found

 

Attachment not found

 

Attachment not found

Please Log in to join the conversation.

More
3 years 6 months ago #268127 by spumco
Need the toolchange.ngc file too

Please Log in to join the conversation.

More
3 years 6 months ago #268135 by tommylight

Need the toolchange.ngc file too
Seems like inside the above ngc file is a call for 0<500> that does not exist.

Please Log in to join the conversation.

More
3 years 6 months ago #268141 by mloser
Sorry about that. Here is toolchange.ngc

Attachment not found

Please Log in to join the conversation.

More
3 years 6 months ago #268173 by mloser
o500 is at the top of toolchange.ngc;ARM_IN subroutine
o500 sub
M64 P0 ; Move arm in
G4 .25 ;wait
M65 P0 ;Remove "arm in" signal
M66 P0 L4 Q4 ; Wait for arm-in LS (low)
O501 if [#5399 LT 0]
(abort, failed to move arm in)
O501 endif
o500 endsub

Please Log in to join the conversation.

More
3 years 6 months ago #268181 by spumco
Ok, hopefully someone else will come along and correct me as I'm a little hazy on O-words and subroutines.

I think what you want to do is put the subroutines at the end of the file, or rename them and save them as separate files.

Like so:
Code:
o<toolchange> sub ... o200 IF [#<_selected_tool> GT 0]         o<arm_in> call ;Arm In         o<unclamp> call ; Unclamp         G53 G0 Z #2 'TODO Move Z to tool change clearance height  ... o<toolchange> endsub

and in your subroutines folder you have files named:
arm_in
arm_out
unclamp
etc.

In my ATC sequence the functions you've got as subroutines have been remapped as M-codes.  My version of your "O500" is "M25", and m25.ngc has been saved in my sub folder.  My version of the sequence above would look like this:
Code:
o<toolchange> sub ... o200 IF [#<_selected_tool> GT 0]         M25 ;Arm In         M24 ; Unclamp         G53 G0 Z #2 'TODO Move Z to tool change clearance height  ... o<toolchange> endsub

Try sticking the subs at the end of the file first.  If that doesn't help, try saving each sub function as a separate file.

Please Log in to join the conversation.

More
3 years 6 months ago #268182 by spumco
And another thing...

The LCNC manual cautions against putting comments on the same line as O-words.

linuxcnc.org/docs/devel/html/gcode/o-code.html

You might try removing the comments in the main toolchange "oNNN call" lines first and see if that's the issue.

Please Log in to join the conversation.

More
3 years 5 months ago #272437 by CNCGOOS
Question.

where do you have savend the file toolchange.ngc?

Please Log in to join the conversation.

Time to create page: 0.097 seconds
Powered by Kunena Forum