Options

  • Todd Zuercher
  • Todd Zuercher's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
10 Feb 2016 04:52 #69911 by Todd Zuercher
Options was created by Todd Zuercher
I'm working on building a Gladevcp panel to replace an old Pyvcp one. A couple of the buttons in the old panel were used to trigger a couple of Halui commands that in turn commanded a couple of custom M1xx codes to turn off vacuum clamping.

I worked ok, and i'm sure that I could make the Gladevcp work that way, or activate the M1xx codes directly. I'm just not sure that this is the best way to make it work. There just seems to be so many ways to possibly make this work. What are some of your oppinions of the best ways to get it done.

I think I would like to have some onscreen feed back of the state of the vacuum clamping. Also what are some ways to make this work, so that the clamping can be turned on and off regardless of linuxcnc's state kind of like mist/lube, but also be able to still use the custom M1xx codes.

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

More
10 Feb 2016 15:44 #69929 by andypugh
Replied by andypugh on topic Options

I'm working on building a Gladevcp panel to replace an old Pyvcp one. A couple of the buttons in the old panel were used to trigger a couple of Halui commands that in turn commanded a couple of custom M1xx codes to turn off vacuum clamping..


There is a GladeVCP button type that can run a G-code command directly.
www.linuxcnc.org/docs/html/gui/gladevcp....d_action_mdi_widgets

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

  • Todd Zuercher
  • Todd Zuercher's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
10 Feb 2016 18:59 #69948 by Todd Zuercher
Replied by Todd Zuercher on topic Options
But that still has to shift Linuxcnc into MDI mode, so you can't make a change during a run. Just trying to weigh all the options before i commit to one way of doing this.

What would be the best way to do this without requiring MDI, so that something can be turned on/off while in auto mode?

Maybe I'll decide MDI is the best way to go, but I'd still like to know how to make the other way work.

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

More
10 Feb 2016 19:20 #69952 by andypugh
Replied by andypugh on topic Options

What would be the best way to do this without requiring MDI, so that something can be turned on/off while in auto mode?.


Halui requires the machine to be in MDI mode too (or, at least not in Auto mode).

What do the M-codes do?

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

  • Todd Zuercher
  • Todd Zuercher's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
10 Feb 2016 19:51 #69954 by Todd Zuercher
Replied by Todd Zuercher on topic Options

What would be the best way to do this without requiring MDI, so that something can be turned on/off while in auto mode?.


Halui requires the machine to be in MDI mode too (or, at least not in Auto mode).

What do the M-codes do?


halcmd sets ...

The ones I'm working on right now turn on and off vacuum clamping for the router table.

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

More
10 Feb 2016 23:03 #69967 by andypugh
Replied by andypugh on topic Options

What do the M-codes do?


halcmd sets ...

The ones I'm working on right now turn on and off vacuum clamping for the router table.


Well, you seem to already be doing things the hard way...

Why not link the PyVCP pins of a toggle switch directly to the HAL pin that controls the vacuum?

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

More
11 Feb 2016 07:22 #69981 by Rick G
Replied by Rick G on topic Options
Perhaps look at ...
M62 - M65 Digital Output Control
linuxcnc.org/docs/html/gcode/m-code.html#mcode:m62-m65
and a OR2 in hal for your buttons.

Rick G

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

  • Todd Zuercher
  • Todd Zuercher's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
15 Feb 2016 15:56 #70166 by Todd Zuercher
Replied by Todd Zuercher on topic Options
Ok, I've made something that does what I want it to do. But I am not sure it is the best way to accomplish it.
I wanted a pair of radio buttons. (I like the visual feed back they give of the state of on/off.) Then I also wanted a pair of M-codes that could also turn on/off the same thing. And last of all I wanted the the radio buttons to change when the M-codes were used.

So when my vacuum was turned off, the "Off" radio button was active, and when the vacuum was on the "On" button is active. The only way I could think of to make it work was to create a hal pin in the gladevcp's python file and use that to change the set_active(True) for the appropriate radio button.
like this:
def on_vacuum_state_value_changed(self, pin):
        state = pin.get()
        if state:
            self.vac_on.set_active(True)
        else:
            self.vac_off.set_active(True)
Then using the hal pin from the hal radiobutton to actually trigger the signal to the propper out put pin(s).

It seems a little backwards to me to have the M-code trigger the the glade button, but I just couldn't think up another way that worked. (without using MDI for the Glade)
The following user(s) said Thank You: MadGuest

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

Moderators: HansU
Time to create page: 0.166 seconds
Powered by Kunena Forum