Implementation of code to run linuxcnc

More
07 Nov 2017 16:17 #101495 by agsarg
Hello everyone sorry if the post is misplaced, and sorry in advance i´m relatively new to this:

I am working on a project that when i click a button (on the axis gui for ex) it executes a series of commands (sort of mdi mode) g01 moves mainly and checks the probe input value to decide the next command also i need to save the high value of the probe in a text file. Correct me if i am wrong but i am supposed to use the pyvcp to create the button but i can t understand how to link it to my program. I ve alredy read this linuxcnc.org/docs/2.6/html/common/python...nuxcnc_python_module witch i think i need to use but again i cant understand how to implement it. Thanks for everyone time and thanks in advance

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

More
07 Nov 2017 17:47 #101498 by Todd Zuercher
Pyvcp is one way to create such a button. Another is Gladevcp.
I don't believe that you would use the python module with Pyvcp. Pyvcp is pretty basic in what you can do. It is basically a collection of widgets that you can use to build a vcp. The widgets create hal pins that allow the vcp to interact with Linuxcnc. (I am not real sure why it's called Pyvcp, because you only use an XML file to create the panels, Maybe because the widgets are written in Python? But the isn't any Python involved with setting up a Pyvcp that I know of.)

Gladevcp is more flexible. This is where you can use the python module. There you can use Glade to build your vcp, and you have the choice of using hal widgets that create halpins to interact with Linuxcnc simularly to how pyvcp does, and/or you can use python and the python module to interact directly with your program and Linuxcnc.

It sounds like you want vcp buttons to execute several of probing routines. Is this what you want? The probing routines, would be simple G-code sub programs, called by MDI commands triggered by the vcp buttons.

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

More
07 Nov 2017 18:14 #101500 by agsarg
First of all thanks a lot for your reply.
It is exactly what i need. can you point me some info you think i could use to achieve this? should i pick gladevcp from the stepconfig picker? i ve only used axis so far. where the code should be located to send the mdi commands? then where the text saving orders should be located. Thanks a lot man

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

More
07 Nov 2017 18:29 #101501 by Todd Zuercher
I would start by reading up on everything related to probing.
Have you read this section of the manual?
linuxcnc.org/docs/2.7/html/gcode/g-code.html#gcode:g38
and looked at the example file "smartprobe.ngc?
So once you can get your probing subroutines set up how you'd like them. Configuring a Glade pannel to call the MDI command to run them is super simple.

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

More
08 Nov 2017 16:04 #101523 by andypugh
GladeVCP includes a widget called an "MDI Button" which directly calls a G-code command. For more complicated results you just make that an O-word subroutine call.

As this is a project you probably don't want to be told that all this is already handled by:
forum.linuxcnc.org/49-basic-configuratio...h-probe?limitstart=0

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

More
08 Nov 2017 18:41 #101529 by agsarg
It s fantastic! ive been analyzing a little bit the smartprobe.ngc. That post is great, I ve never installed a gui before though, correct me if i am wrong but i think i have to go to the sources link at the end of the post, then click clone (?not sure about this) and add the configuration to the ini file so when i run axis it should appear as a tab. Thanks a lot man lot of things for me to learn!

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

More
08 Nov 2017 19:27 #101530 by andypugh
For this it is probably easier to download the ZIP file rather than install Git and clone it.

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

More
09 Nov 2017 15:56 #101565 by newbynobi
Just to mention,
gmoccapy does include that fearure, you can put any ngc file as macro.
If you do that, on the mdipage you get automaticaly a button for each macro, (max. 9 macros are allowed)

It is well documented in the doc files.

IMHO tochy does offer that also.

Norbert

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

More
10 Nov 2017 13:46 #101601 by agsarg
Hello thanks for the tip, yesterday i succesfully installed the probe test gui andy posted here and wired up the probe on the hal. it worked. i tested the probe test gui as a tab on axis and y made a simple g38.2 repeated trajectory to test the proble closing and opened it as a normal ngc file. So the real advantage in having that tab should be to send a g38.2 to recognize a surface without having to type the code? am i right? where could i modify the code so when i make a test i can save the coordinates using command (log.xxxxx) macros folder? thanks

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

Time to create page: 0.222 seconds
Powered by Kunena Forum