- Posts: 15
- Thank you received: 0
various linking signal problems
1. The max velocity slider isn't working at all. I linked the halui.max-velocity.scale signal in postgui.hal but it does not change.
2. I'd like to change the text of the Status Label with something that reflects the status of the machine(Emergency on, Ready, Running, Paused or so), and don't know what to do.
3. The Spindle Toggle Button works only to turn on the spindle and not to turn it off. I've linked the spindle-run halui.spindle.start to the button, but don't know how to link the spindle-run halui.spindle.stop to its off-state. For the other 2 outputs I've cheated using the toggle function and a normal button, but i'd like to adjust them to use a proper toggle button.
4. Damned combo box! How can I pass that unsigned int to an oword subroutine???? I've tryed to call the function with that Set button, but I don't know if I'm passing the parameter correctly or is something wrong in the subroutine.. Much confusion here
5. To do.. I'm planning to remap M6 when I'm done with this, but by then I should have lerned a bit more
6. Is it possible to do points from 1 to 4 avoiding python???
Thanks
config here
Attachment not found
Please Log in to join the conversation.
2 requires a python handler file and python code
3 would require either python code or HAL plumbing to convert the single Gladevcp HAL pin to two HAL pins (probably the toggle component)
4 I haven't worked with gladevcp's combo box or oword subroutines much - I know you must add a list store and set that up - this might help:
Chris
Please Log in to join the conversation.
But at last I managed to implement an M6 remap
Please Log in to join the conversation.
Chris M
Please Log in to join the conversation.
Please Log in to join the conversation.
2.7 is a bit limited with GSTAT but still quite useful.
This handler file assumes that there are three labels called:
state_label
e_state_label
interp_state_label
and a regular push button with a 'pressed' signal that calls 'on_button1_pressed' (set up in GLADE file)
It will create two HAL pins spindle-on-trigger and spindle-off-trigger to be connected to HALUI
You would have to adjust the gladevcp command to load the handler file too.
Chris M
Please Log in to join the conversation.
Labels are working. Is there a list of that GSTATs available to monitor? Are these returning always a boolean value to use?
The button is working too, but I've noticed it's a bit glitchy. If the spindle is set to run from axis, if I try to stop it with the glade button it wont. The same if i start it with the glade one and than stop it from axis, when i try to start it again from glade button it wont. I think it keeps the old state because from axis it does not refresh the pin..
Time for experiments. Let u know the news
Thanks for help
Please Log in to join the conversation.
I think the problem is sending the variable to the called oword with the Set button.
I don't feel I'm doing the right way...Actually the mdi command is like so:
O<testtenda> call [${gfloat1-f}]
the oword subroutine is this
O <testtenda> sub
o101 if [#1 EQ 54]
G54
o101 elseif [#1 EQ 55]
G55
o101 elseif [#1 EQ 56]
G56
o101 elseif [#1 EQ 57]
G57
o101 elseif [#1 EQ 58]
G58
o101 elseif [#1 EQ 59]
G59
o101 elseif [#1 EQ 60]
G59.1
o101 elseif [#1 EQ 61]
G59.2
o101 elseif [#1 EQ 62]
G59.3
o101 endif
O <testtenda> endsub
M2
Please Log in to join the conversation.
dangu85 wrote: ok. I'm starting to get it little by little.
Labels are working. Is there a list of that GSTATs available to monitor? Are these returning always a boolean value to use?
The button is working too, but I've noticed it's a bit glitchy. If the spindle is set to run from axis, if I try to stop it with the glade button it wont. The same if i start it with the glade one and than stop it from axis, when i try to start it again from glade button it wont. I think it keeps the old state because from axis it does not refresh the pin..
Time for experiments. Let u know the news
Thanks for help
from source, you can glean the return type from the gobject.TYPE:
The 2.8/master version has way more and docs too.
glichy button is because the HAL pin is only toggled the next time the GUI buttons are pressed. If something else toggles linuxcnc state the pins are not reset properly. You could probably fix that with timers between setting the pin true to set it false after a half second, but at that point you may as well add some more python and control the spindle in python.
adding:
import linuxcnc
CMD = linuxcnc.command()
CMD.spindle(linuxcnc.SPINDLE_FORWARD)
CMD.spindle(linuxcnc.SPINDLE_REVERSE)
CMD.spindle(linuxcnc.SPINDLE_OFF)
Chris M
Please Log in to join the conversation.
def flood_pressed(self, obj):
state = True
CMD.flood(linuxcnc.FLOOD_ON)
# is flood already enabled?
if GSTAT.stat.flood_enabled:
state = False
CMD.flood(linuxcnc.FLOOD_OFF)
# toggle HAL pins to command HALUI
self.on_trigger3.set(state)
self.off_trigger3.set(not state)
I think it's not correct to check for flood_enabled ...mmmm...
Please Log in to join the conversation.
