Page 1 of 1

Re: Probing stock macro help

PostPosted: Fri Dec 28, 2018 8:28 am
by Dan911
On Xmas vacation and have some play time, I expended on the example form from the UCCNC manual.

Dress the form up as you like, I added keypress events on textbox's to only allow digits and 1 decimal are allowed. I commented in macro where to add rectangle and circle probe macro's.

Test Form.JPG
Test Form.JPG (20.43 KiB) Viewed 13354 times


M21222.txt
(4.93 KiB) Downloaded 780 times

Re: Probing stock macro help

PostPosted: Fri Dec 28, 2018 6:47 pm
by Dan911
I realized you may need negative values for the X and Y textbox's so replace X and Y keypress events with code below. This will allow minus sign(negative) only on start.

Don't mean to insult if mentioning the obvious but.... these textbox strings will need to be converted to double to use in your probe macro's.

Have Fun,
Dan

Code: Select all
if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) &&
                   (e.KeyChar != '.') && (e.KeyChar != '-'))
            {
                e.Handled = true;
            }

            // only allow one decimal point
            if ((e.KeyChar == '.') && ((sender as TextBox).Text.IndexOf('.') > -1))
            {
                e.Handled = true;
            }

            //0nly allow minus on start
            if (e.KeyChar == '-' && (textBox1.SelectionStart != 0 || textBox1.Text.Contains("-")))
            {
                e.Handled = true;
            }

Re: Probing stock macro help

PostPosted: Sat Dec 29, 2018 9:18 pm
by Dan911
Hi Gabi, I hope you don't mind but going to answer your PM here, it's threads like this that help others.

There are many probe macro's available that can easily be edited to what you want/posted. For starters take a look in your default macro folder(M31).

Check out A_Camera thread/macro's that can be found here.... viewtopic.php?f=9&t=538

Also, you can purchase the 2017 screenset..... http://www.thecncwoodworker.com/2017.html the macro's alone are well worth the 20 buc cost. There is also a Macro thread on the zone.

As far as the TextBox being strings...............

double Tbox1 = Convert.ToDouble(textBox1.Text)
double Tbox2 = Convert.ToDouble(textBox2.Text)
double Tbox3 = Convert.ToDouble(textBox3.Text)

Take a look at some of the probe macro/links I posted and any questions I will be happy to help.

Dan

Re: Probing stock macro help

PostPosted: Sun Dec 30, 2018 3:38 pm
by Dan911
Hi Gabi,

I didn't give any thought to this other than what you requested in post. My form example was taken from the UCCNC manual and I expanded with textboxes and checkbox's to show how to use the textbox info based on what was checked. With that being said......

Looking at first line of program>>>> exec.Code("G31 X" + Xmin + " F" + ProbeFeedrate);

Xmin is a variable for "X"
ProbeFeedrate is a variable for "F"( feedrate)

In the start of the macro you would declare these variables.

string Xmin = textbox4.text;
string ProbeFeedrate = textbox5.text;

or

double Xmin = Convert.ToDouble(textBox4.Text);
double ProbeFeedrate = Convert.ToDouble(textBox5.Text);

Since a probing macro can be complicated I suggest using a written 1, read manual first before making any attempt in editing it. In the Documentation folder in your UCCNC directory there's tons of info.

Dan

Re: Probing stock macro help

PostPosted: Mon Dec 31, 2018 7:17 pm
by dezsoe
Hi Gabi,

You could check the latest test version for a probing collection.

Re: Probing stock macro help

PostPosted: Tue Jan 01, 2019 1:59 am
by Dan911
dezsoe wrote:Hi Gabi,

You could check the latest test version for a probing collection.


Wow....Looks great!!!!

Re: Probing stock macro help

PostPosted: Tue Jan 01, 2019 11:52 am
by dezsoe
Hi,

I didn't make any videos, I think the drawings, the status line and the detailed doc should be enough. Take care of the C clearance: it has to be negative to lower the Z when finding outers. The dot on the mode buttons always shows where the probe has to be when you start a probing sequence.