Tool Changer

More
22 Oct 2012 08:36 #25585 by tkamsker
Replied by tkamsker on topic Re:Tool Changer
Hi,
I did check that thats why i posted the question in the forum
My ini has more but i copiued only this 3 sections
[DISPLAY]
DISPLAY = axis
EDITOR = gedit
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 1.2
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 5
PROGRAM_PREFIX = /home/tkamsker/linuxcnc/configs/Heiz400T-3WZW
INCREMENTS = 5mm 1mm .5mm .1mm .05mm .01mm .005mm
PYVCP = ToolChPanel.xml
[HAL]
HALUI = halui
HALFILE = Heiz400T-3WZW.hal
HALFILE = custom.hal
POSTGUI_HALFILE = custom_postgui.hal

[HALUI]
# HalUI-MDI-Befehle hier einfügen (max. 64)
# MDI commands
MDI_COMMAND = T1 M6 G43
MDI_COMMAND = T2 M6 G43
MDI_COMMAND = T3 M6 G43
MDI_COMMAND = T4 M6 G43
MDI_COMMAND = T5 M6 G43
MDI_COMMAND = T6 M6 G43
MDI_COMMAND = T6 M6 G43
MDI_COMMAND = T6 M6 G43

and The XML is an exact copy of that thread for the start

And the custom_postgui.hal is
# Benutzerdefinierte HAL-Anweisungen können nachfolgend angegeben werden
# Die Befehle in dieser Datei werden nach der AXIS GUI (und PyVCP-Panel) ausgeführt.
# MDI Commands
#net too1-1 halui.mdi-command-00 <= pyvcp.tool-1
#net too1-2 halui.mdi-command-01 <= pyvcp.tool-2
#net too1-3 halui.mdi-command-02 <= pyvcp.tool-3
#net too1-4 halui.mdi-command-03 <= pyvcp.tool-4
#net too1-5 halui.mdi-command-04 <= pyvcp.tool-5
#net too1-6 halui.mdi-command-05 <= pyvcp.tool-6
#net too1-7 halui.mdi-command-06 <= pyvcp.tool-7
#net too1-8 halui.mdi-command-07 <= pyvcp.tool-8


now commented out that i can work manually
So i see the 8 Buttons
My idea was that i do simply an Collet On and Collet off button which simply call M101 and M102
Then the T1 T6 buttons wich would Translate to Tx M6 <cr> o<ww> call <cr>
Where <cr> is carrige return
I wanted to stay verry simple

So the error
custom_postgui.hal:4: Unknown command 'net tool-1 halui.mdi-command-00 <= pyvcp.tool-1'

was not clear how to tackle it. Can i switch on debug or is it simply the wrong section for that command does it need to be set later or earlier ?

In my day profession i am a developer but i did so far spent no time in the code and i hope that this is not now necessary ;)-

So if someone already had similar issue or has an hint would be verry welcome ,..

Because when this is finnished (and i can dio the pcb i try ) then i might be able to finnish the arduino based pendant ,..
Where i have an working prototpye,..
thx
thomas

Please Log in or Create an account to join the conversation.

More
22 Oct 2012 10:21 - 22 Oct 2012 10:26 #25587 by ArcEye
Replied by ArcEye on topic Re:Tool Changer
Hi

It's quite simple, I have copied all of Johns entry into sim files and the problem is that the <pyvcp> </pyvcp> tags are missing from the .xml file

Should be
<?xml version='1.0' encoding='UTF-8'?>
<pyvcp>

    <labelframe text="Tool Changer">
    <font>("Helvetica",16)</font>
    <hbox>
      <button>
      <halpin>"tool-1"</halpin>
      <text>"T1"</text>
      <bd>3</bd>
      </button>
      <button>
      <halpin>"tool-2"</halpin>
      <text>"T2"</text>
      <bd>3</bd>
      </button>
      <button>
      <halpin>"tool-3"</halpin>
      <text>"T3"</text>
      <bd>3</bd>
      </button>
      <button>
      <halpin>"tool-4"</halpin>
      <text>"T4"</text>
      <bd>3</bd>
      </button>
    </hbox>

    <hbox>
      <button>
      <halpin>"tool-5"</halpin>
      <text>"T5"</text>
      <bd>3</bd>
      </button>
      <button>
      <halpin>"tool-6"</halpin>
      <text>"T6"</text>
      <bd>3</bd>
      </button>
      <button>
      <halpin>"tool-7"</halpin>
      <text>"T7"</text>
      <bd>3</bd>
      </button>
      <button>
      <halpin>"tool-8"</halpin>
      <text>"T8"</text>
      <bd>3</bd>
      </button>
    </hbox>
    </labelframe>
 
</pyvcp>

This is the running proof



Another benefit of always running programs from the terminal, you get to see all the error messages.

regards
Attachments:
Last edit: 22 Oct 2012 10:26 by ArcEye.

Please Log in or Create an account to join the conversation.

More
22 Oct 2012 11:51 #25592 by BigJohnT
Replied by BigJohnT on topic Re:Tool Changer
ArcEye wrote:

Hi

It's quite simple, I have copied all of Johns entry into sim files and the problem is that the <pyvcp> </pyvcp> tags are missing from the .xml file


Good catch! I didn't even think of the pyvcp tags when I copied that part from the much larger xml file.

John

Please Log in or Create an account to join the conversation.

More
22 Oct 2012 12:35 #25600 by tkamsker
Replied by tkamsker on topic Re:Tool Changer
Hi,
I thought on that as well
my xml
is like

<pyvcp>
<labelframe text="Tool Changer">
<font>("Helvetica",16)</font>
    <hbox>
      <button>
      <halpin>"tool-1"</halpin>
      <text>"T1"</text>
      <bd>3</bd>
      </button>
      <button>
      <halpin>"tool-2"</halpin>
      <text>"T2"</text>
      <bd>3</bd>
      </button>
      <button>
      <halpin>"tool-3"</halpin>
      <text>"T3"</text>
      <bd>3</bd>
      </button>
      <button>
      <halpin>"tool-4"</halpin>
      <text>"T4"</text>
      <bd>3</bd>
      </button>
    </hbox>

    <hbox>
      <button>
      <halpin>"tool-5"</halpin>
      <text>"T5"</text>
      <bd>3</bd>
      </button>
      <button>
      <halpin>"tool-6"</halpin>
      <text>"T6"</text>
      <bd>3</bd>
      </button>
      <button>
      <halpin>"tool-7"</halpin>
      <text>"T7"</text>
      <bd>3</bd>
      </button>
      <button>
      <halpin>"tool-8"</halpin>
      <text>"T8"</text>
      <bd>3</bd>
      </button>
    </hbox>
  </labelframe>
</pyvcp>


So the Tags are here
I do get the command unknown and that is not clear how to tackle that one ,..
thx
tk

Please Log in or Create an account to join the conversation.

More
22 Oct 2012 12:45 #25601 by BigJohnT
Replied by BigJohnT on topic Re:Tool Changer
Did you put the MDI commands in the ini file in the correct place?

linuxcnc.org/docs/html/config/ini_config..._sub_halui_section_a

John

Please Log in or Create an account to join the conversation.

More
22 Oct 2012 13:02 #25603 by andypugh
Replied by andypugh on topic Re:Tool Changer
"unknown command" is a strange error message, as I would expect "pin not found" if it was a problem with the PyVCP or the MDI_COMMANDs.

You can check that the halui.mdi-command and pyvcp pins exist by using Machine->Show HAL Config to bring up the Halshow widget.
My suggestion is that they do.

I wonder if the problem is some sort of windows line-ending problem? Is the interpreter baffled by the "<LF>net" command?

Please Log in or Create an account to join the conversation.

More
22 Oct 2012 13:03 - 22 Oct 2012 13:05 #25604 by ArcEye
Replied by ArcEye on topic Re:Tool Changer

So the Tags are here
I do get the command unknown and that is not clear how to tackle that one


You will just have to zip your complete config folder and attach it.

The code works, as demonstrated, there must be something in the way it is implemented in your configs which is causing the error.

(or as I have just seen Andy say, your files are littered with CR / LF or other control chars if done on a word processor)

regards
Last edit: 22 Oct 2012 13:05 by ArcEye.

Please Log in or Create an account to join the conversation.

More
22 Oct 2012 13:52 #25610 by BigJohnT
Replied by BigJohnT on topic Re:Tool Changer
A little grepping in the source finds this code that triggered the "Unknown command" error is in src/hal/utils/halcmd.c:
static int parse_cmd1(char **argv) {
    struct halcmd_command *command = bsearch(argv[0],
                halcmd_commands, halcmd_ncommands,
		sizeof(struct halcmd_command), compare_command);
    int argc = count_args(argv);

    if(argc == 0)
        return 0;

    if(!command) {
	// special case: sig = newvalue
	if(argc == 3 && strcmp(argv[1], "=")) {
	    return do_setp_cmd(argv[0], argv[2]);
	} else {
            halcmd_error("Unknown command '%s'\n", argv[0]);
            return -EINVAL;
        }

Don't know if this sheds some light on the picture...

John

Please Log in or Create an account to join the conversation.

More
23 Oct 2012 07:56 #25660 by ArcEye
Replied by ArcEye on topic Re:Tool Changer

A little grepping in the source finds this code that triggered the "Unknown command" error is in src/hal/utils/halcmd.c:

That code is part of the command line parsing from halcmd, seems unlikely.

There are some others, if you do a case insensitive search, but equally unlikely.

I wonder if it isn't just a BabelFish, German to English translation thing?

Anyway can't do anything else without the configs, your code works fine, there is something else in the mix.

regards

Please Log in or Create an account to join the conversation.

More
23 Oct 2012 15:14 #25675 by BigJohnT
Replied by BigJohnT on topic Re:Tool Changer
I did a case sensitive search to find the exact one with the "C" as you found out the case insensitive search brings up other hits.

John

Please Log in or Create an account to join the conversation.

Time to create page: 0.297 seconds
Powered by Kunena Forum