- Posts: 2580
- Thank you received: 0
Custom user Button Touchoff in Axis
- snowgoer540
- Offline
- Platinum Member
-
phillc54 wrote:
All the code for this needs to be in plasmac_axis.py, you should be able to find in there where HAL pins are created and also the function that runs every cycle.snowgoer540 wrote: Give me one quick nudge here please... where is the proper place to establish the "axisui.refresh" HAL pin? Hal connections file?
so I am guessing axis_remote --reload is not the proper way to send this command inside of the plasmax_axis? commands.reload doesnt appear to work either lol
Please Log in to join the conversation.
Please Log in to join the conversation.
- snowgoer540
- Offline
- Platinum Member
-
- Posts: 2580
- Thank you received: 0
phillc54 wrote: Close, commands.reload_file() does the trick. You can look in axis.py for all those commands.
I must be doing something wrong.
I'm trying to take this in baby steps so I don't have too much go wrong at once.
doesn't seem to do anything. Edit: my ini file is setting that pin to 1, I confirmed that.
I did figure out that the rest of the needed commands are:
Then I just need to figure out how to increment...something...so that it does each every cycle.
Please Log in to join the conversation.
Yep, they are the correct commands
hal.set_p will set a HAL pin
Please Log in to join the conversation.
- snowgoer540
- Offline
- Platinum Member
-
- Posts: 2580
- Thank you received: 0
phillc54 wrote: After the == remove the both the ' from the 1, that denotes text and it is an integer.
Yep, they are the correct commands
hal.set_p will set a HAL pin
I cant get it to do any one of these things... I think the snakes must be feeling particularly lazy today. I thought I had to use S32 pin to be able to use values other than 0 and 1. But when I do that, it doesnt change the value to 1. This must be like watching a toddler learn to crawl :laugh:
Please Log in to join the conversation.
Do the hal.set_p lines before the commands lines.
You do need to start LinuxCNC each time you change this file.
That's all I can help with tonight, see ya tomorrow.
Please Log in to join the conversation.
- snowgoer540
- Offline
- Platinum Member
-
- Posts: 2580
- Thank you received: 0
I would imagine Phill will push this (if he hasnt already), but to do this, you need to add the following code after line 816 (not 100% sure this is the best place to add it):
Then you need to add a pin in the add a pin area (before comp.ready()):
Lastly, your button code in your ini file becomes:
well, I can crawl a little further now than before...
Please Log in to join the conversation.
Great work, now all you need to do is add it into the user guide, create a new branch and submit a PR.snowgoer540 wrote: Got it working! I've been sitting here for a few hours, but I learned a lot, and good news is I can move on with the day now :lol: For instance, I learned that you cant use tabs, after beating my head against the wall for nearly an hour... tab does not equal 4 spaces lol
Can you set up whatever IDE/editor you are using to use spaces instead of tabs?
Edit: HAL_IN for the pin would be ok.
Please Log in to join the conversation.
- snowgoer540
- Offline
- Platinum Member
-
- Posts: 2580
- Thank you received: 0
phillc54 wrote:
Great work, now all you need to do is add it into the user guide, create a new branch and submit a PR.snowgoer540 wrote: Got it working! I've been sitting here for a few hours, but I learned a lot, and good news is I can move on with the day now :lol: For instance, I learned that you cant use tabs, after beating my head against the wall for nearly an hour... tab does not equal 4 spaces lol
Can you set up whatever IDE/editor you are using to use spaces instead of tabs?
Edit: HAL_IN for the pin would be ok.
Thanks, it is exciting when you get it to work finally...
I'm not sure, I will have to check, I was using Geany.
I wondered about IN vs IO, I looked it up and misread Table 1 here: linuxcnc.org/docs/html/hal/halmodule.html I thought the columns were related, I see now it's 3 rows...
I would actually be happy to add it to the user manual while I am editing. I'be made it down to line 258 haha, got a little bit to go.
I would need a noob guide to github to create a branch and make a pull request. This seems best done from Linux on the machine, but the last time I tried I couldnt figure it out.
Please Log in to join the conversation.
The recent doc changes I made are below, pink are deletions and green are additions:
For the compressed backup:
github.com/LinuxCNC/linuxcnc/commit/9bb4...d5fdf0bb042ffa3ed7e1
For the final probe speed:
github.com/LinuxCNC/linuxcnc/commit/4dc4...d5fdf0bb042ffa3ed7e1
For the 2.8 release:
github.com/LinuxCNC/linuxcnc/commit/4db0...d5fdf0bb042ffa3ed7e1
Edit: these are the changes I ended up with.
Attachment not found
Please Log in to join the conversation.
