Call O Codes from hal signal

More
05 Dec 2021 17:12 #228391 by Pro_El
I am starting to learn for subroutines. I finished one mill tool-change with Ladder. My next project is tool-change with axis movement positions. I think subs will be the best choise, fix me if i am wrong.  i cannot find some very obvious staff.. 

My first question will be can i start subroutines with signal from Hall in Auto mode

Thanks a lot 

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

More
05 Dec 2021 18:24 #228399 by anfänger
Yes you can take a look at

HALUI:

halui.mdi-command-XX bit in

halui looks for ini variables named [HALUI]MDI_COMMAND, and exports a pin for each command it finds. When the pin is driven TRUE, halui runs the specified MDI command. XX is a two digit number starting at 00. If no [HALUI]MDI_COMMAND variables are set in the ini file, no halui.mdi-command-XX pins will be exported by halui.
 

You might need to remap your O Word to a user Code first. But after this it's no probem

linuxcnc.org/docs/html/config/ini-config...l#gcode:ini-features
linuxcnc.org/docs/html/man/man1/halui.1.html
linuxcnc.org/docs/html/remap/remap.html

Cheers 

Patrick
 
The following user(s) said Thank You: Pro_El, zz912

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

More
05 Dec 2021 21:42 #228406 by Pro_El
Replied by Pro_El on topic Call O Codes from hal signal
Great start for me, I will make this on machine and test it how is working

Thanks again anfänger

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

More
20 Mar 2023 13:41 #267148 by zz912
Replied by zz912 on topic Call O Codes from hal signal
Exist some specification of halui.mdi-command-XX ?
Or exmaple?

In INI file:
[HALUI]
MDI_COMMAND
or
[HALUI]
MDI_COMMAND.ngc
?

In config folders must be file:
MDI_COMMAND.ngc
?
Can / must be it in some subfolder.

The *.ngc file must contain M2?

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

More
20 Mar 2023 15:30 #267154 by andypugh
There are some examples here: github.com/LinuxCNC/linuxcnc/blob/master...hb04/layout1.inc#L32

I think that, for example:
MDI_COMMAND = O<my_subroutine> CALL
should work
The following user(s) said Thank You: zz912

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

More
20 Mar 2023 15:30 #267155 by andypugh
There are some examples here: github.com/LinuxCNC/linuxcnc/blob/master...hb04/layout1.inc#L32

I think that, for example:
MDI_COMMAND = O<my_subroutine> CALL
should work
The following user(s) said Thank You: zz912

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

More
20 Mar 2023 15:47 #267159 by zz912
Replied by zz912 on topic Call O Codes from hal signal
Thank you.
MDI_COMMAND=(debug, example: mdi-01)

What "debug" command mean?

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

More
20 Mar 2023 16:12 #267162 by andypugh
It's a "magic comment"

linuxcnc.org/docs/stable/html/gcode/over....html#gcode:comments

Listed elsewhere, there is also:

(ABORT, ...) Which stops execution with a message and (py, ...) which will execute python code. (and also (pyrun, ) and (pyreload, ). I don;t know what the last two do.
The following user(s) said Thank You: zz912

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

Time to create page: 0.092 seconds
Powered by Kunena Forum