Led linked to the state of a Physical pin???

More
06 Jan 2015 02:13 #54603 by mmt
Here are my M code files

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

More
06 Jan 2015 02:15 #54604 by andypugh
What do the M-codes look like?

You won't be able to "sets" a signal linked to a HAL output pin (note that physical parport input pins are output pins to HAL)

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

More
06 Jan 2015 02:19 #54605 by mmt
I can't get them to post

here are the contents

M101

# Laser Beam Enable
halcmd sets beam-on 1
exit 0

M102

# Laser Beam Disable
halcmd sets beam-on 0
exit 0

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

More
06 Jan 2015 03:10 #54608 by andypugh
I think the problem will be that the hal-checkbutton instantly over-rides the sets command
net beam-on gladevcp.hal_checkbutton1 gladevcp.hal_led1
If you want to be able to operate it from both a checkbutton _and_ a G-code then things get more complicated.
The following user(s) said Thank You: mmt

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

More
07 Jan 2015 04:59 - 07 Jan 2015 05:05 #54693 by mmt
Andy thank you for your help.

I swithched from the check button to 2 buttons ( on and off ) using a hal mdi command to activate the m code with an led and used your suggestion

"net theled gladevcp.led_1 parport.0.pin-01-out (or some pin that is an actual output)

Then the M101 bash script can be

halcmd sets theled 1"

I works perfect now. Thanks again
Last edit: 07 Jan 2015 05:05 by mmt.

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

More
10 Jan 2015 00:54 #54829 by mmt
OK I jumped the gun by saying that it works perfect.

When I hit the run button on a program, Glade grays out my M code buttons and my leds and the M codes will not function from the program.

what do I need to add and where? Something to my postgui. hal file?

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

More
10 Jan 2015 01:49 #54832 by andypugh

When I hit the run button on a program, Glade grays out my M code buttons and my leds and the M codes will not function from the program.


Ah, yes. That is a problem.

The buttons to call the M-codes are "MDI" buttons and are not active in "Auto" mode. (ie, when a program is running).

This actually makes some sense, as there can only really be one source of G-code instructions active at any one time.

This is going to seem over-complicated, but I suggest that you link the M-code value, some GUI buttons and the halui.mode-is-auto pin through a LUT5 component. Then you can set up the output to do whatever it is that you really want to happen in each mode.

(LUT5 allows you to specify the state of an outpbut bit for every possible combination of up to 5 input bits, like an arbitray 5-input logic gate)
The following user(s) said Thank You: mmt

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

More
10 Jan 2015 01:55 #54833 by mmt
Thank you again Andy. It worked.

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

More
10 Jan 2015 01:59 #54834 by andypugh

Thank you again Andy. It worked.


Crikey! That was quick, I was mentally braced for a week of explaining LUT5 :-)

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

Moderators: mhaberlerHansU
Time to create page: 0.155 seconds
Powered by Kunena Forum