Axis - user defined keys

More
05 Mar 2014 23:42 - 07 Mar 2014 19:26 #44444 by ArcEye
Hi

This idea springs from this thread
www.linuxcnc.org/index.php/english/forum...ne-button-touch-offq
in which Regnar wanted to use a HID type pendant, which emulates keystrokes, to activate a command launching pyvcp button.

Because the pyvcp button has no accelerator (and providing them appeared fraught with dangers), it was not possible to directly do so.
It made me wonder why Axis does not just have user defined commands assigned to 'hot keys'.

The modified files will create a 'User' menu on the Axis menubar, with menuitems User0 through to User9
Optionally the keyboard bindings for number keys 0-9 can be assigned directly to these 10 commands.

At startup Axis reads the ini file section [USER_COMMANDS]

Under this are listed up to 10 commands like so

USER0 = #setp iocontrol.0.lube_level 1
USER1 = G0 X0 Y0 Z0
USER2 = G0 X5 Y5 Z5
USER3 = G0 X10 Y10 Z10
USER4 = G0 X15 Y15 Z15
USER5 = G0 X20 Y20 Z20
USER6 = G0 X25 Y25
USER7 = G0 X30 Y30
USER8 = $firefox "www.linuxcnc.org"
USER9 = $gedit

# precedes a halcmd
This will be sent and the return waited for before continuing

$ precedes a system command
This will be spawned to a new process and return immediately

No prefix before a gcode instruction

Optionally the variable
NUMBERKEYS = YES / NO

Use this carefully, the main reason for its inclusion
is to allow HID type pendant to operate commands from keystrokes
If using a keyboard probably best set to NO and just use Alt U + n (0-9) to activate the command

EDIT:
The new zip contains modified files for the master and 2.5.3
The 2.5.3 versions will probably work with other 2.5.x versions but likely not to work with 2.4

There is a config folder which can be copied to your config directory and runs a sim which enables you to experiment with the ini file settings

There is also a README file, once all else has failed, try reading it :laugh:
(especially regards setting file attributes and user, zipping files tends to screw these up)

Usual caveats apply, not warranted fit for anything, could wreck your machine if not used properly.
If of use - enjoy

regards
Attachments:
Last edit: 07 Mar 2014 19:26 by ArcEye.
The following user(s) said Thank You: Tchefter

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

More
06 Mar 2014 21:38 #44497 by andypugh
Replied by andypugh on topic Axis - user defined keys
Do you think this should be merged to the standard install?

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

More
07 Mar 2014 00:54 #44506 by ArcEye
Replied by ArcEye on topic Axis - user defined keys

Do you think this should be merged to the standard install?


If enough people find it useful, it could be quite easily.

I need to speak to Chris M or Dewey who use tcl a lot and sort out why the menu does not get created in 2.5.3.
It must be something very simple, but I could not see what it was, the same changes to the axis.tcl file produce the menu in the master.

regards

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

More
07 Mar 2014 01:41 #44510 by ArcEye
Replied by ArcEye on topic Axis - user defined keys
OK, have sorted the 2.5.3 problem

A formatting error caused the menu entry not to be created in the 2.5.3 tcl file, even though it had been declared

Tomorrow I will test and produce a new zip with replacements for 2.5.3 and the master.

regards

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

More
07 Mar 2014 19:32 #44527 by ArcEye
Replied by ArcEye on topic Axis - user defined keys
Update

The zip on post one now has amended files for both master and 2.5.3.

Read the README, you will need to set the files to the correct permissions etc
zipping them always seems to strip those

regards

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

More
28 Jan 2018 10:58 #105104 by Tchefter
Replied by Tchefter on topic Axis - user defined keys
Hi, does this procedure have to be applied to version 2.7.11?
I need some User Commands, but it seems its not so easy for a noob...:unsure: :)

Regards Fritz

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

More
01 Feb 2018 07:38 #105275 by Tchefter
Replied by Tchefter on topic Axis - user defined keys
Hi again :)
no one use this feature? I updated currently to 2.7.12.
Is there a solution for?

Regards Fritz

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

More
04 Feb 2018 14:56 - 04 Feb 2018 14:56 #105405 by Tchefter
Replied by Tchefter on topic Axis - user defined keys
Well, I did it, it works. Perfect! Thanks for not responding to my question, not meant bad, so I had to fight through there myself and it was not so difficult. Thanks ArcEye for your work!

Greetings Fritz



i'm a bit proud :)
Attachments:
Last edit: 04 Feb 2018 14:56 by Tchefter.

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

More
23 Feb 2018 17:44 #106405 by andypugh
Replied by andypugh on topic Axis - user defined keys

Well, I did it, it works. Perfect! Thanks for not responding to my question,


ArcEye posted the original message in 2014. I don't think he hangs out here any more.

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

More
23 Feb 2018 17:52 - 23 Feb 2018 17:52 #106408 by Tchefter
Replied by Tchefter on topic Axis - user defined keys

ArcEye posted the original message in 2014.


Yes, i know, but its helpful also in V2.7.12

I don't think he hangs out here any more.


Something I've already thought, that's a pity if it were so.

Regards Fritz
Last edit: 23 Feb 2018 17:52 by Tchefter.

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

Time to create page: 0.147 seconds
Powered by Kunena Forum