- Posts: 85
- Thank you received: 0
momentary signal push button (not latch) in user-commands (0-9 keyboard)
3 years 5 months ago #272483
by fery15sty
momentary signal push button (not latch) in user-commands (0-9 keyboard) SOLVED was created by fery15sty
can anyone help me..
can i use user-command (0-9 number in keyboard) to be a momentary signal.
I do not know what to do.
in my ini file, like this:
[USER_COMMANDS]
USER0 =
USER1 = #setp or2.4.in1 1
USER2 =
USER3 =
USER4 =
USER5 =
USER6 =
USER7 =
USER8 =
USER9 =
NUMBER KEYS = YES
can i use user-command (0-9 number in keyboard) to be a momentary signal.
I do not know what to do.
in my ini file, like this:
[USER_COMMANDS]
USER0 =
USER1 = #setp or2.4.in1 1
USER2 =
USER3 =
USER4 =
USER5 =
USER6 =
USER7 =
USER8 =
USER9 =
NUMBER KEYS = YES
Please Log in to join the conversation.
3 years 5 months ago #272554
by andypugh
Replied by andypugh on topic momentary signal push button (not latch) in user-commands (0-9 keyboard)
I don't recognise the [USER_COMMANDS] INI entry.
Which user interface are you using?
Which user interface are you using?
Please Log in to join the conversation.
3 years 5 months ago #272573
by fery15sty
Replied by fery15sty on topic momentary signal push button (not latch) in user-commands (0-9 keyboard)
I use the method as in this link.
forum.linuxcnc.org/21-axis/27577-axis-user-defined-keys
I want to make a custom keyboard to connect to the hal pin.
I don't know any other way to custom keyboard button
forum.linuxcnc.org/21-axis/27577-axis-user-defined-keys
I want to make a custom keyboard to connect to the hal pin.
I don't know any other way to custom keyboard button
Please Log in to join the conversation.
3 years 5 months ago #272574
by fery15sty
Replied by fery15sty on topic momentary signal push button (not latch) in user-commands (0-9 keyboard)
can i make a new keyboard button that can be connected with hal pin?
How to do it?
How to do it?
Please Log in to join the conversation.
3 years 5 months ago #272576
by andypugh
Replied by andypugh on topic momentary signal push button (not latch) in user-commands (0-9 keyboard)
You can connect a physical button to a GPIO pin and access the value in HAL.
The you would "net" that GPIO HAL pin to your or2.4.in1 HAL pin.
There are various ways to save GPIO pins by using matrix wiring, like keyboards use. See, for example, the matrix_kb HAL component.
linuxcnc.org/docs/stable/html/man/man9/matrix_kb.9.html
But until you have a large number of buttons, that is an unnecessary complication.
For user-interaction where realtime scanning is not necessary, there are other options such as using a Pokeys or an Arduino, too.
The you would "net" that GPIO HAL pin to your or2.4.in1 HAL pin.
There are various ways to save GPIO pins by using matrix wiring, like keyboards use. See, for example, the matrix_kb HAL component.
linuxcnc.org/docs/stable/html/man/man9/matrix_kb.9.html
But until you have a large number of buttons, that is an unnecessary complication.
For user-interaction where realtime scanning is not necessary, there are other options such as using a Pokeys or an Arduino, too.
Please Log in to join the conversation.
3 years 5 months ago #272584
by fery15sty
Replied by fery15sty on topic momentary signal push button (not latch) in user-commands (0-9 keyboard)
not a new keyboard with lots of keys, but keys that are already present on a standard keyboard. I will connect the buttons that are not used to the hal pin
R = Run
Esc = Stop
P = pause
S = Resume
for example, I want to use button
F = Forward (forward adaptive feed)
V = Reverse (reverse adaptive feed)
Forward and reverse, I will connect it with hal pins. Or create a new hal pins.
Maybe I should custom axis.py or axis.tcl?
how to do it?
R = Run
Esc = Stop
P = pause
S = Resume
for example, I want to use button
F = Forward (forward adaptive feed)
V = Reverse (reverse adaptive feed)
Forward and reverse, I will connect it with hal pins. Or create a new hal pins.
Maybe I should custom axis.py or axis.tcl?
how to do it?
Please Log in to join the conversation.
3 years 5 months ago #272598
by andypugh
Replied by andypugh on topic momentary signal push button (not latch) in user-commands (0-9 keyboard)
Well, the forum post you originally linked to required a custom version of Axis, didn't it?
But, it is pretty unlikely that the modified version of Axis there (for v2.5) will work well with the current 2.8 version as a lot has changed in the meantime.
I don't see any sign of [USER_COMMANDS] here: linuxcnc.org/docs/stable/html/gui/axis.html#_user_command_file so I don't think the customisation there was ever merged.
But, it is pretty unlikely that the modified version of Axis there (for v2.5) will work well with the current 2.8 version as a lot has changed in the meantime.
I don't see any sign of [USER_COMMANDS] here: linuxcnc.org/docs/stable/html/gui/axis.html#_user_command_file so I don't think the customisation there was ever merged.
Please Log in to join the conversation.
3 years 5 months ago #272619
by fery15sty
Replied by fery15sty on topic momentary signal push button (not latch) in user-commands (0-9 keyboard)
I have done the for custom axis.py dan axis.tcl, and it can run on 2.8,but the signal on the button works like a toggle with a locked signal, I want the button to work like a push button, with a momentary signal
Please Log in to join the conversation.
3 years 5 months ago #272629
by fery15sty
Replied by fery15sty on topic momentary signal push button (not latch) in user-commands (0-9 keyboard)
SOLVED
I use the manual method as used in jog_plus and jog_minus in axis.py.
and all working..
r = axisui.key-run-adaptive
p = axisui.key-pause-adaptive
s = axisui.key-resume-apadtive
m = axisui.key-forward-adaptive
n = axisui.key-reverse-adaptive
I use the manual method as used in jog_plus and jog_minus in axis.py.
and all working..
Code:
####################################
def run_adaptive(event=None):
comp['key-run-adaptive'] = 1
def pause_adaptive(event=None):
comp['key-pause-adaptive'] = 1
def resume_adaptive(event=None):
comp['key-resume-adaptive'] = 1
def reverse_adaptive(event=None):
comp['key-reverse-adaptive'] = 1
def forward_adaptive(event=None):
comp['key-forward-adaptive'] = 1
def stop_adaptive(event=None):
comp['key-run-adaptive'] = 0
comp['key-pause-adaptive'] = 0
comp['key-resume-adaptive'] = 0
comp['key-reverse-adaptive'] = 0
comp['key-forward-adaptive'] = 0
###################################
root_window.bind("<KeyPress-r>", nomodifier(commands.run_adaptive))
root_window.bind("<KeyRelease-r>", commands.stop_adaptive)
root_window.bind("<KeyPress-p>", nomodifier(commands.pause_adaptive))
root_window.bind("<KeyRelease-p>", commands.stop_adaptive)
root_window.bind("<KeyPress-n>", nomodifier(commands.reverse_adaptive))
root_window.bind("<KeyRelease-n>", commands.stop_adaptive)
root_window.bind("<KeyPress-m>", nomodifier(commands.forward_adaptive))
root_window.bind("<KeyRelease-m>", commands.stop_adaptive)
root_window.bind("<KeyPress-s>", nomodifier(commands.resume_adaptive))
root_window.bind("<KeyRelease-s>", commands.stop_adaptive)
###################################
comp.newpin("key-run-adaptive", hal.HAL_BIT, hal.HAL_OUT)
comp.newpin("key-pause-adaptive", hal.HAL_BIT, hal.HAL_OUT)
comp.newpin("key-resume-adaptive", hal.HAL_BIT, hal.HAL_OUT)
comp.newpin("key-reverse-adaptive", hal.HAL_BIT, hal.HAL_OUT)
comp.newpin("key-forward-adaptive", hal.HAL_BIT, hal.HAL_OUT)
r = axisui.key-run-adaptive
p = axisui.key-pause-adaptive
s = axisui.key-resume-apadtive
m = axisui.key-forward-adaptive
n = axisui.key-reverse-adaptive
Please Log in to join the conversation.
3 years 4 months ago #272632
by andypugh
Replied by andypugh on topic momentary signal push button (not latch) in user-commands (0-9 keyboard)
I was going to suggest two different options, depending on what behaviour you wanted.
1) Instead of using "setp" directly, call a routine that sets, then resets the pin.
2) Look through the axis modifications and set it up so that you can also map actions to the key-release event.
1) Instead of using "setp" directly, call a routine that sets, then resets the pin.
2) Look through the axis modifications and set it up so that you can also map actions to the key-release event.
Please Log in to join the conversation.
Time to create page: 0.139 seconds
