GladeVCP for feed_override

More
10 Aug 2017 20:44 #97316 by MatthiasF1210
MatthiasF1210 created the topic: GladeVCP for feed_override
Hello,

I am doing my first steps with GladeVCP. My Goal is to set a fixed feed_override by a button. So I greated a file "velocity_mod.glade" and "velocity_mod.hal". The glade file has some buttons and a led. For testing I connected the hal as follows
net test1     velocity_mod.btn_feedrate_10p  => velocity_mod.led1
net test2     velocity_mod.btn_feedrate_25p  => gmoccapy.reset-feed-override

I did all the setup at the INI and started GMOCCAPY. When I press the Button 10P in the new panel the LED is toggling. When I press the Button 25P feed override is reset. Every thing is fine so far. When I ad the following line

net test3     velocity_mod.btn_feedrate_50p =>  gmoccapy.feed-override-value = 0.5

GMOCCAPY isn't showing my panel any more...

Any Ideas?


Matthias
More
14 Aug 2017 12:02 #97448 by andypugh
andypugh replied the topic: GladeVCP for feed_override
your test3 is not valid HAL.

HAL is a net-list, it defines how pins are connected. But it isn't a programming language, it runs only once at startup.

Python _is_ a programming language, and you can link a bit of Python to each button with GladeVCP, and use that to set the feed override.

linuxcnc.org/docs/2.7/html/gui/gladevcp....gladevcp:programming
More
16 Aug 2017 18:25 #97590 by newbynobi
newbynobi replied the topic: GladeVCP for feed_override
I would recommend to use a MUX4 component, to select the different overrides.

Norbert
More
16 Aug 2017 19:25 #97594 by MatthiasF1210
MatthiasF1210 replied the topic: GladeVCP for feed_override
Hi everybody,

thanks for the hints. I just found some time today to play around a little bit.

I wrote a little python script as follows.
import linuxcnc
cmd = linuxcnc.command()

def btn_feedrate_10p_pressed(gtkobj,data=None):
    cmd.feedrate(0.1)

def btn_feedrate_25p_pressed(gtkobj,data=None):
    cmd.feedrate(0.25)

def btn_feedrate_50p_pressed(gtkobj,data=None):
    cmd.feedrate(0.5)

def btn_feedrate_80p_pressed(gtkobj,data=None):
    cmd.feedrate(0.8)

def btn_feedrate_110p_pressed(gtkobj,data=None):
    cmd.feedrate(1.1)

and than attached it to my vcp
EMBED_TAB_COMMAND = gladevcp -x {XID} -u velocity_mod.py velocity_mod.glade

It works fine so far in simulation, I will test it at the weekend at my real machine.
Any comments for that approach?

Thanks

Matthias
Moderators: newbynobi
Time to create page: 0.090 seconds
Powered by Kunena Forum