M codes

More
27 Apr 2011 19:16 - 27 Apr 2011 19:25 #9422 by andradela
Replied by andradela on topic Re:M codes
Very nice it works now, but I have another question, I want to use a input to confirm that M code when done, for example, M110 "open collet" input "5" collet opened confirm, when this input =1 the program change line.

follow my script


#!/bin/sh

# file to turn on paraport pin 14 to open the collet closer

halcmd setp parport.0.pin-14-out true

exit 0
Last edit: 27 Apr 2011 19:25 by andradela.

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

More
27 Apr 2011 19:27 #9424 by andypugh
Replied by andypugh on topic Re:M codes
Sorry, you are on your own there.
I am sure it can be done (getp will return the value of a pin) but bash scripting is a mystery to me.

Look on the internet for bash scripting guides.

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

More
02 May 2011 00:45 #9531 by andradela
Replied by andradela on topic Re:M codes
why this command does't works in terminal window
halcmd: setp parport.0.pin-14-out
<stdin>:13: parameter or pin 'parport.0.pin-14-out' not found

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

More
02 May 2011 11:58 #9537 by BigJohnT
Replied by BigJohnT on topic Re:M codes
Did you start hal and load the parallel port driver?

John

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

More
02 May 2011 13:51 #9541 by andradela
Replied by andradela on topic Re:M codes
No, how can I do it?

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

More
02 May 2011 14:17 #9542 by BigJohnT
Replied by BigJohnT on topic Re:M codes
The HAL tutorial is here:

www.linuxcnc.org/docview/html/hal_tutorial.html

John

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

More
02 May 2011 16:18 #9545 by andradela
Replied by andradela on topic Re:M codes
ok
thanks

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

More
20 Jun 2011 12:18 #10647 by piasdom
Replied by piasdom on topic Re:M codes
working on Mnnn
i have the file m101 in my PROGRAM_PREFIX directory and it's executable.
i'm trying to call it in my program with m101 p4. i'm getting "unknown m code used"
T'anks !

my m101 file;
#!/bin/sh

feedrate=$2

halcmd setp thc.feedrate $feedrate

exit 0

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

More
20 Jun 2011 12:29 #10648 by BigJohnT
Replied by BigJohnT on topic Re:M codes
p is the $1 variable and q is the $2 variable.

John

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

More
20 Jun 2011 12:58 - 20 Jun 2011 13:01 #10650 by piasdom
Replied by piasdom on topic Re:M codes
so i should have feedrate=$1 ?
but why does it say unknown m code?
to me it doesn't get to the file m101, just the m code itself.
i've tried m101 p4 q0.
Last edit: 20 Jun 2011 13:01 by piasdom.

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

Time to create page: 0.083 seconds
Powered by Kunena Forum