Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: ludo on May 06, 2008, 04:01:20 PM

Title: error in drill wizard?
Post by: ludo on May 06, 2008, 04:01:20 PM
When i try to use the drill circular boltpattern i get always " error on line 27" type mismatch,running  the debug (F7)with next line :
IF Z=0 then...
here i got an error ,but Z=0.5 ,What do i wrong?
Title: Re: error in drill wizard?
Post by: jimpinder on May 07, 2008, 11:40:33 AM
I ahev just tried running this with 6 and 5 holes - and it worked.

I admit that this is on my office machine - not the workshop one, but no problems here.

I enclose the two files from my add-on folder for this. Try them in place of the ones you have.
The third file is the bit maps, which shouldn't affect the running of it.

In both cases knock the XML extension off before you use them.
Title: Re: error in drill wizard?
Post by: ludo on May 07, 2008, 03:53:32 PM
Thanks,I replace the files and remove the xml extensions ,but i got the same error.I post the question also on cnczone.nl  and other people
have the same error.
Title: Re: error in drill wizard?
Post by: Hood on May 07, 2008, 04:02:19 PM
can you post a screenshot to show what digits you are putting in the DROs to get the error as I to have tried this wizard and it works fine for me.
Hood
Title: Re: error in drill wizard?
Post by: ludo on May 07, 2008, 04:29:50 PM
I hope that the photo is clear .Also inputting a negatief number for setting the depth works not good.
Title: Re: error in drill wizard?
Post by: Hood on May 07, 2008, 04:44:05 PM
Tried these settings and they work fine for me.
Can you open the wizard and then go to the operator menu and choose Edit Button Script. The Post Code button should be flashing, clcik on it and then copy and paste whats in it and I will compare to mine.

Hood
Title: Re: error in drill wizard?
Post by: ludo on May 08, 2008, 02:23:24 AM
I can go in the editor ,can use copy ,but not paste the file in the post.Now I use save as ,"HIDDENSCRIPT_LUDO.M1S".Maybe is this usefull
Title: Re: error in drill wizard?
Post by: jimpinder on May 08, 2008, 04:21:18 AM
The only time I can get that error is when entering depths 0f 0.004 or less. I have tried with the machine in inches and working in mm, mm - mm, mm - inches and inches - inches. It is all the same.

The formatting must ignore  4 thous or less. Over 4 thou to 8 thou the formatting interprets this as 0.01. I cannot get the DRO to accept 0.009 - and from 0.01 onward it seems OK.

Reading the formatting instructions, this seems to indicate that Z has two numbers to the right of the decimal place. If more numbers are entered, then the formatting rounds up (or down) to two decimal places - which seems to be in line with my results above

You do not need to put a negative number in the hole depth - the formatting changes the number to a negative number anyway. Just enter the depth you want. If you are in inches - then 1.5, 2.75 etc - to 2 decimal places. If you are metric then 5mm is 5.0 etc. - also to 2 decimal places - but I don't think metric drills go to that (not the ones I use anyway)

Maybe the DRO could be changed to accept only two figures after the decimal place.
Title: Re: error in drill wizard?
Post by: ludo on May 08, 2008, 06:41:06 AM
hello again,

i install mach3 on an other computer,but i got the same error.On that computer is also mach2,in mach2 is the drillwizard ok.
Title: Re: error in drill wizard?
Post by: Hood on May 08, 2008, 07:27:31 AM
This is strange, I do not get that error even when I eneter exactly the same dimensions that you have input. I also looked through the VB and it is identical to mine, this is very strange, if I come up with anything I will let you know..
Hood
Title: Re: error in drill wizard?
Post by: ludo on May 08, 2008, 03:42:20 PM
thanks,for the moment i can always use mach2 to generate the gcode for the drill wizard and use Mach3 to execute.
Title: Re: error in drill wizard?
Post by: ludo on May 09, 2008, 02:16:59 AM
Hello,

when i change Z=formatnumber(Abs(getoemdro(1004))*-1,4) in Z=(abs(getoemdro(1004))*-1) then there is no error,i think there is
something wrong with the format command.
Title: Re: error in drill wizard?
Post by: jimpinder on May 09, 2008, 02:55:34 AM
You are probably right - I do not know what the (4) signifies. It is NOT four numbers after the decimal point, becasue that only goes to two numbers before rounding up or down.

Perhaps Brian can have a look and let us know.
Title: Re: error in drill wizard?
Post by: ludo on May 09, 2008, 04:26:25 AM
Hello again,

I have not mutch experience in programming but i think have a solution for the drill problem.After reading the vbscript doc about the format function i change all the the lines with the function formatnumber into e.g.  Z=format(Abs(getoemdro(1004))*-1,"###,##").
Now it works correct.Maybe is this the reason:Country is set to United States in the International
section of the Control Panel.(page 75).
Title: Re: error in drill wizard?
Post by: jimpinder on May 10, 2008, 04:38:38 AM
I think you have probably found the problem - the formatting seems to work correctly here, but obviously not for you.