Page 1 of 1

Bad character error

Posted: Thu Jun 19, 2014 1:22 pm
by allnew
What would this error in one of the code lines represent ? Without autoleveller, the code works fine. With autoleveller, the program generates the error when I am running it on the cnc machine.
thanks
tony

Re: Bad character error

Posted: Thu Jun 19, 2014 3:00 pm
by daedelus
Can you give me a bit more information.

Can you copy & paste the line and the ones around here please

Re: Bad character error

Posted: Thu Jun 19, 2014 4:47 pm
by allnew
Notice the period after the brackets at N1232....
#102=[#575+0.10259*#587-0.10259*#575]
#101=[#576+0.10259*#588-0.10259*#576]
#100=[#102+0.67476*#101-0.67476*#102]
N1230 X1.1042 Y2.0047 Z[#100 + -0.004]
#102=[#575+0.08828*#587-0.08828*#575]
#101=[#576+0.08828*#588-0.08828*#576]
#100=[#102+0.6741*#101-0.6741*#102]
N1232 X1.104 Y2 Z[#100 + -0.004] .
#102=[#575+0.07154*#587-0.07154*#575]
#101=[#576+0.07154*#588-0.07154*#576]
#100=[#102+0.6751*#101-0.6751*#102]
N1234 X1.1043 Y1.9945 Z[#100 + -0.004]

Re: Bad character error

Posted: Thu Jun 19, 2014 5:46 pm
by daedelus
OK, my initial look at my Autoleveller code didnt tell me much.

Does this happen anywhere else in the file?

Which version of Autoleveller are you using?

If you generate the file again, do you get the same problem in the same place?

If the problem is still there please email the original non-autolevelled file to daedelus@autoleveller.co.uk so I can re-create the issue.

thanks,

Re: Bad character error

Posted: Thu Jun 19, 2014 10:54 pm
by daedelus
Thanks for sending the file. This is interesting...

The original line is:
N1232 X1.104 Y2.

which is interpreted by the Autoleveller as:
N1232 X1.104 Y2 Z[#100 + -0.004] .

Autoleveller is using the regular expression "-?[0-9]*[\\.,]?[0-9]+" to search for valid numbers in the line. The regex essentially says if there is a point in the number then it must be followed by 1 or more digits, and in this case there are no more digits after the period. So it reads 2 correctly then reads the period as a separate entity. The Y value should be either Y2 or Y2.0 but not Y2.

I think the Autoleveller is correct with its interpretation of numbers but I would like to get someone else's opinion on this?

So, the question is, is "2." a valid number or must it be "2" or "2.0" even?

What software generated the file?

In the meantime you can just use a text editor to search and replace "] ." with "]". There are only 3 places in the levelled file with this problem that I found.

Re: Bad character error

Posted: Thu Jun 19, 2014 11:56 pm
by allnew
I am using Mastercam to generate the code. And yes, I've been using a text editor to remove the period.
Fortunately, it's an easy problem for the editor.
tony cervone

Re: Bad character error

Posted: Fri Jun 20, 2014 2:57 pm
by daedelus
Hi Tony,

I still think this is a strange notation, but Mastercam is a big program so I have made the changes to AutoLeveller to comply with their floating point notation. I have made the change to v0.8.2 only so its completely up to you whether you want to purchase it or not.

I will email you the file which v0.8.2 has output (unmodified by text editor) so you can see the result. thanks.