Loading M codes at startup: interp_error. Bug?

More
10 years 6 months ago #73504 by DaBit
It is possible to setup default G-codes in the INI file using the [RS274NGC]RS274NGC_STARTUP_CODE entry.
But when I enter M codes there, such as M53 P1 LinuxCNC crashes. Or at least the gmoccapy GUI does; that is just a blank window.

The actual startup code line is:
RS274NGC_STARTUP_CODE = G18 G64P0.01 G90 G92.1 G7 M53P1

This results in:
Code:
dabit@emco8:~/linuxcnc/configs/emco8$ linuxcnc emco8.ini LINUXCNC - 2.7.4 Machine configuration directory is '/home/dabit/linuxcnc/configs/emco8' Machine configuration file is 'emco8.ini' Starting LinuxCNC... . Found file(REL): ./emco8.hal Found file(REL): ./custom.hal emc/task/emctask.cc 389: interp_error: Multiple p words on one line Multiple p words on one line emc/task/emctaskmain.cc 3011: can't initialize interpreter

Problem seems more 'mutliple P words' than the actual M code. Not sure if this is a bug or not.
Is there an easy workaround?

System is stock Debian from the ISO with LinuxCNC 2.7.4

Please Log in to join the conversation.

More
10 years 6 months ago #73515 by andypugh

DaBit wrote: Problem seems more 'mutliple P words' than the actual M code. Not sure if this is a bug or not.
Is there an easy workaround?


The order of words in a G-code block is not considered when parsing the block.
One side-effect of this is that the interpreter has no way to know which P-number to pass to which command.

You may have to make your RS274NGC_STARTUP_CODE into a subroutine call which splits the G64 and M53 onto different lines.
I don't know what happens if you have more than one RS274NGC_STARTUP_CODE line. It might be worth experimenting.
Code:
RS274NGC_STARTUP_CODE (MSG, this is line 1) RS274NGC_STARTUP_CODE (MSG, And this is line 2)
for example.

Please Log in to join the conversation.

Time to create page: 0.070 seconds
Powered by Kunena Forum