M101 again

More
15 Mar 2010 04:27 #2310 by Timbob
M101 again was created by Timbob
Hey guys, I'm back with a little bad news. I got the file set up and it doesn't stop the program with an error anymore but it still dose not trip the relay. I have tried every thing I can think of with no luck. I changed the config to coolant on / coolant off to that pin and it work fine.I must be missing something here.
Thanks in advance
Tim

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

More
15 Mar 2010 11:15 #2311 by Rick G
Replied by Rick G on topic Re:M101 again
Hello,

You might try .. open hal, select watch and then select the pins you are using to see what is changing when you run your command. In hal you can also enter commands to test them, try yours and see if it works there. Also now that you have a new command in your file maybe paste the current file.

Rick G

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

More
15 Mar 2010 22:38 #2314 by Timbob
Replied by Timbob on topic Re:M101 again
I'm not sure how to write a command I tried everything I can think of. When I click on wach the screen goes blank. Is there maybe an easier way to open and close two more switches? I'm not doing so good with this one.
Thanks Tim

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

More
16 Mar 2010 10:24 #2318 by BigJohnT
Replied by BigJohnT on topic Re:M101 again
What exactly are you trying to do?

John

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

More
16 Mar 2010 14:55 #2321 by Timbob
Replied by Timbob on topic Re:M101 again
I'm trying to open and close two air cylinders with pin 14 and Pin 1
Thanks Tim

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

More
16 Mar 2010 21:54 #2328 by Rick G
Replied by Rick G on topic Re:M101 again
Tim,

What you are trying to do makes sense.
If I understand correctly your plan is to apply a signal to a parallel port pin with hal.
From the parallel port the signal goes to your breakoutboard which contains the relay for the cylinder. What breakout board are you using?

After you start EMC select Machine /show Hal configuration in EMC then select watch, select the pins you want to watch and enter your command at the bottom to see if it works. You can also try your command from the MDI line of EMC or by running a file.
If working the status of the pin should change. If the pin changes and your relay still does not work check your pin numbers.

Good luck and let us know how it is working out.

Rick G

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

More
17 Mar 2010 11:17 - 17 Mar 2010 11:20 #2335 by BigJohnT
Replied by BigJohnT on topic Re:M101 again
To get even more basic than that comment out the line in your hal file for pin 1 and 14. Open the Show Hal Configuration window. Navigate to the parallel port pins and click on pin 1 so it shows up in the Show tab. In the Test HAL command: box you can turn on and off the pin to test out your hardware by using the following command.
setp parport.0.pin-01-out 1

A "1" is on and "0" is off. When you turn it on the status will change and you will see it as TRUE.

Also I have seen pin 1 not to work on some parallel ports as an output as it is the strobe line I think.

John
Last edit: 17 Mar 2010 11:20 by BigJohnT.

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

More
17 Mar 2010 21:17 #2345 by Timbob
Replied by Timbob on topic Re:M101 again
After selecting the line with parport 14
I typed [m101] setp parport.0.pin-14-out 1 [/m102]
clicked execute and got Error invalid code
tanks Tim

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

More
18 Mar 2010 12:28 #2352 by BigJohnT
Replied by BigJohnT on topic Re:M101 again
In the HAL Show window you do not use the m101 only the command itself.

John

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

More
19 Mar 2010 03:08 - 19 Mar 2010 03:12 #2362 by Timbob
Replied by Timbob on topic Re:M101 again
When I type in the command word for word as advised, it still comes back error message "invalid command name code. That is why I tried using M101 and M102 in place of code. If I assign spindle brake on off to pin 14, all the hardware works correctly.
I am sure my file is in the correct directory becasue it runs through on the program when I run it. In the configuration file I set pin 14 out 01. I have tried all of the others with no luck.

M101
#!/bin/bash
# file to turn on paraport pin 14 to open the collet closer
halcmd setp parport.0.pin-14-out True
exit 0

M102
#!/bin/bash
# file to turn off paraport pin 14 to open the collet closer
halcmd setp parport.0.pin-14-out False
exit 0
It is set to be an executable and in home /tim/emc/nc

My command in the program test code(which I wrote) is simply M101 and M102.

G20 f95
G1 X9.0000 Y2.0000 A11.0000
M 101
G1 X0.0000 Y0.0000 A0.000
M 102

I use a hobbycnc pro 4 axis driver board


Forgive me for my lack of knowledge, I am still learning. This one thing has been the toughest so far, and the one thing that stops me from production. I have built this machine to manufacture a product I have invented, the entire thing has been a college course or two for me in the past 7 months.

Any help is appreciated.
Tim
Last edit: 19 Mar 2010 03:12 by Timbob.

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

Time to create page: 0.075 seconds
Powered by Kunena Forum