Post GUI HAL not loading and "Bad character '[' used" error on E-Stop

More
2 years 2 months ago #308249 by nwallace
I am having an issue with a machine using probe basic where the post gui hal files are not loading. Looking at the console output when running linuxcnc from the terminal does not show an obvious error to me. It just gets to the line where it is trying to load the first post gui hal file and stops. I have tried removing any customizations but it has no effect. Attached are my hal and ini files.

Another possibly related issue I am having is that if I ever use the e-stop, I get 2 "Bad character '[' used" errors. The error shown in the terminal is "emc/task/emctask.cc 68: interp_error: Bad character '[' used" and it happens even if I have no file loaded.

Has anyone encountered either of these problems? I am at a loss of where to look next on either and would appreciate any help.

Please Log in to join the conversation.

More
2 years 2 months ago #308270 by Aciera
You've got a lot going on there.
Only thing I see are these MDI_COMMANDS that will cause syntax errors due to comma instead of semicolon but I have no idea if those are actually used anywhere.:
Code:
MDI_COMMAND = o<sweep_4x8> call,Sweep\n4x8 #MDI_COMMAND = o<measure_tool> call,Measure\nCurrent\nTool MDI_COMMAND = G53 G0 Z0;G53 G0 X63 Y5,Go To\nMTC Location MDI_COMMAND = M64 P7,Open Tool\nMagazine MDI_COMMAND = M65 P7,Close Tool\nMagazine

If you run this in MDI do you also get the error about the Bad character '[':
Code:
(abort, aborting)

Please Log in to join the conversation.

More
2 years 2 months ago #308278 by Aciera
Another thing that comes to mind is that only one POSTGUI_HALFILE entry is allowed (unless that has changed):
Code:
POSTGUI_HALFILE = custom_postgui.hal POSTGUI_HALFILE = vc-postgui.hal POSTGUI_HALFILE = probe_basic_postgui.hal

So if you wanted to load more than one postgui_hal file you would have to create a single (eg 'postgui_call_list.hal') file like this:
Code:
# These files are loaded post GUI, in the order they appear source custom_postgui.hal source vc-postgui.hal source probe_basic_postgui.hal

Then you would replace the three POSTGUI_HALFILE entries with this single line:
Code:
POSTGUI_HALFILE = postgui_call_list.hal

Maybe that helps

Please Log in to join the conversation.

More
2 years 2 months ago #308317 by nwallace
Thank you very much for the help! I feel a bit lame for not realizing that you could only have one postgui_halfile. That has solved that issue.

As for the bad character issue, yes (abort, aborting) does trigger that error but only once instead of twice like an e-stop would.

Please Log in to join the conversation.

More
2 years 2 months ago #308324 by Aciera
Not sure if you can have a mix of G- and M-commands like that for an 'ON_ABORT_COMMAND' so try commenting out this line in your ini and see if the error still occurs:
Code:
ON_ABORT_COMMAND = G54 G17 G90 G94 M48 G40 M5 G80 M9

If that fixes it then you may want to use a subroutine call instead. Something like this:
Code:
ON_ABORT_COMMAND = o<on_abort> call

and create a subroutine 'on_abort.ngc' with all the command you want to run on abort
Code:
o<on_abort> sub ;Your Gcodes ;Your Mcodes o<on_abort> endsub M2

Please Log in to join the conversation.

More
2 years 2 months ago #308325 by nwallace
You were correct about the 'ON_ABORT_COMMAND' not working with all those commands. I will go the subroutine route.

I realized I forgot to comment on the MDI_COMMANDS section. Those are formatted that way to show up as buttons in the UI. Everything after the comma is treated as the button text. I just used an example bit of code from the pull request on github to set it up. github.com/kcjengr/probe_basic/pull/84

That example code uses the INI format from QTDragon.

Please Log in to join the conversation.

More
2 years 1 month ago #309511 by nwallace
turns out that a traditional sub call does not work in the ON_ABORT_COMMAND option either. It appears that it strips out the <> characters. It errors on a e-stop saying it can't find a subroutine called "Oon_abort". I think I will have to go the custom M code route instead.

Please Log in to join the conversation.

More
2 years 1 month ago #309520 by Aciera
Certainly works for me:
github.com/Sigma1912/LinuxCNC_Demo_Confi...ort_no_twp_reset.ngc

with this in the [RS247NGC] section of the ini:
Code:
ON_ABORT_COMMAND = o <on_abort_no_twp_reset> call

Please Log in to join the conversation.

More
2 years 1 month ago #309874 by nwallace
Turns out the issue was no M2 or M30 at the end of the file. I was just using the % markers at the beginning and end which is the wrong way to do that.

Please Log in to join the conversation.

Time to create page: 0.201 seconds
Powered by Kunena Forum