M codes

More
15 years 6 months ago #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

Please Log in to join the conversation.

More
15 years 6 months ago #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 to join the conversation.

More
15 years 5 months ago #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 to join the conversation.

More
15 years 5 months ago #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 to join the conversation.

More
15 years 5 months ago #9541 by andradela
Replied by andradela on topic Re:M codes
No, how can I do it?

Please Log in to join the conversation.

More
15 years 5 months ago #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 to join the conversation.

More
15 years 5 months ago #9545 by andradela
Replied by andradela on topic Re:M codes
ok
thanks

Please Log in to join the conversation.

  • piasdom
  • New Member
  • New Member
More
15 years 4 months ago #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 to join the conversation.

More
15 years 4 months ago #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 to join the conversation.

  • piasdom
  • New Member
  • New Member
More
15 years 4 months ago #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.

Please Log in to join the conversation.

Time to create page: 0.451 seconds
Powered by Kunena Forum