Page 2 of 3

Re: comma as decimal separator in cnc code

Posted: Thu Oct 08, 2015 8:27 pm
by andrew
Makes sense, yes. Update attached.

Changes:
- always prepare for cutting before defining arc center (CC)

Re: comma as decimal separator in cnc code

Posted: Fri Oct 09, 2015 11:23 am
by peter
andrew, it works fine, thank you so much!
first move is executed on Z level 0 but should be Z Clear?

1 TOOL DEF 01 L+ R+0.6
2 TOOL CALL 01 Z S 2000
3 L X+1,272 Y+0,400 R0 F9999 M13
4 L Z-0,300 R0 F30 M
5 L X+0,272 R0 F30 M
6 L Y-0,533 R0 F30 M
7 CC X+0,737 Y-1,136
8 C X+0,806 Y-0,378 DR- R0 F30 M
9 CC X+0,745 Y-1,018
10 C X+1,206 Y-1,467 DR- R0 F30 M
11 CC X+0,777 Y-1,046
12 C X+0,250 Y-1,333 DR- R0 F30 M
13 L Z+1,000 R0 F9999 M13 F30
14 L X-1,350 R0 F9999 M13
15 L Z-0,300 R0 F30 M
16 CC X-0,814 Y-1,027
17 C X-0,817 Y-1,644 DR+ R0 F30 M
18 CC X-0,817 Y-1,122
19 C X-0,817 Y-0,600 DR+ R0 F30 M
20 CC X-0,817 Y-0,078
21 C X-0,817 Y+0,444 DR+ R0 F30 M
22 CC X-0,813 Y-0,139
23 C X-1,350 Y+0,089 DR+ R0 F30 M
24 L Z+1,000 R0 F9999 M30

Re: comma as decimal separator in cnc code

Posted: Fri Oct 09, 2015 12:14 pm
by andrew
peter wrote:our first move seems to be executed on Z level 0 but should be Z Clear?
Can you correct the first 4 lines of the program and post them, so I can update the configuration, thanks.

Re: comma as decimal separator in cnc code

Posted: Fri Oct 09, 2015 3:35 pm
by peter
1 TOOL DEF 01 L+ R+0.6
2 TOOL CALL 01 Z S 2000
3 L X+1,272 Y+0,400 R0 F9999 M13
4 L Z-0,300 R0 F30 M
5 L X+0,272 R0 F30 M
6 L Y-0,533 R0 F30 M
7 CC X+0,737 Y-1,136
8 C X+0,806 Y-0,378 DR- R0 F30 M
'
'

andrew, I am not shure, it may be perfect as it is, it looks like original TNC145 header syntax, I have to find it out on the machine.

Re: comma as decimal separator in cnc code

Posted: Mon Oct 12, 2015 11:42 am
by peter
behavior of TNC is perfect with the actual header syntax, moving 3 L X+1,272 Y+0,400 R0 F9999 M13 with holding last Z level, then 4 L Z-0,300 R0 F30 M

to get program input to TNC145 without error. there must be

1 TOOL DEF 01 L+ R+0.6 >>>>>>>>> 1 TOOL DEF 01 L+0 R+0.6 <<<<<<<<<<<<<< L+0
2 TOOL CALL 01 Z S 2000
3 L X+1,272 Y+0,400 R0 F9999 M13
4 L Z-0,300 R0 F30 M
5 L X+0,272 R0 F30 M
6 L Y-0,533 R0 F30 M
7 CC X+0,737 Y-1,136
8 C X+0,806 Y-0,378 DR- R0 F30 M
9 CC X+0,745 Y-1,018
10 C X+1,206 Y-1,467 DR- R0 F30 M
11 CC X+0,777 Y-1,046
12 C X+0,250 Y-1,333 DR- R0 F30 M
13 L Z+1,000 R0 F9999 M13 F30 >>>>>>>>> 13 L Z+1,000 R0 F9999 M13 <<<<<<<<<<<<<< without F30
14 L X-1,350 R0 F9999 M13
15 L Z-0,300 R0 F30 M

Re: comma as decimal separator in cnc code

Posted: Mon Oct 12, 2015 11:49 am
by andrew
OK, great. Thanks for the confirmation.

Re: comma as decimal separator in cnc code

Posted: Mon Oct 12, 2015 11:58 am
by peter
13 L Z+1,000 R0 F9999 M13 F30 >>>>>>>>> 13 L Z+1,000 R0 F9999 M13 <<<<<<<<<<<<<< without F30

feedrate is set twice in one line is not perfect at the moment (manually edited with no problem)

Re: comma as decimal separator in cnc code

Posted: Mon Oct 12, 2015 12:22 pm
by andrew
OK, update attached.

Re: comma as decimal separator in cnc code

Posted: Mon Oct 12, 2015 3:16 pm
by peter
thank you, I've just checked CAM output file, looks perfect, fine! Machine test result will be posted later, an other question, for output file extension *.cnc instead of *.nc how to manage, please?

Re: comma as decimal separator in cnc code

Posted: Mon Oct 12, 2015 3:21 pm
by andrew
peter wrote:an other question, for output file extension *.cnc instead of *.nc how to manage, please?
Add this to your configuration:
Tnc145.prototype.getFileExtensions = function() {
    return ["cnc"];
};

Re: comma as decimal separator in cnc code

Posted: Mon Oct 12, 2015 3:36 pm
by peter
andrew, thank you for your great job, QCADCAM 3.11.0 is fine for me, looks very good in work results!

Re: comma as decimal separator in cnc code

Posted: Sat Nov 28, 2015 6:58 pm
by olly
Good point!

This will be interesting for my TNC 430 to engrave Labels
I try to extend TNC 415 to TNC 430
Extension .cnc to .h no problem!

TrueType etc. is nice with QCad CAM ;-)
Normal contours and holes I process with my own software
Is it possible to disable layers, in my case useful for "CAM-Labels" not for the rest! (one complete CAD-file) ?

TOOL CALL with "GRAV" (comes from a Tool table) corrupts the script !
Solution for inserting " ?

is it possible to catch the filename SCHRIFT.DXF or alternativ the name of the Layer to feed the first and last line
to complete the CNC-file?

0 BEGIN PGM SCHRIFT MM
1 TOOL CALL "GRAV" Z S2500
4 L Z-0,300 R0 F30 M
5 CC X+0,000 Y+0,000
6 C X-100,000 Y+0,000 DR+ R0 F30 M
7 CC X+0,000 Y+0,000
8 C X+100,000 Y+0,000 DR+ R0 F30 M
9 L Z+1,000 R0 F9999 M30
10 END PGM SCHRIFT MM

Re: comma as decimal separator in cnc code

Posted: Mon Nov 30, 2015 9:20 am
by andrew
olly wrote:Is it possible to disable layers, in my case useful for "CAM-Labels" not for the rest! (one complete CAD-file) ?
Yes, simply hide those layers in the layer list (eye icon) before exporting to CAM.
olly wrote:TOOL CALL with "GRAV" (comes from a Tool table) corrupts the script !
Solution for inserting " ?
Quotes have to be escaped in JavaScript strings:
this.writeLine("TOOL CALL \"GRAV\" Z S2500");
is it possible to catch the filename SCHRIFT.DXF or alternativ the name of the Layer to feed the first and last line
to complete the CNC-file?
File name of exported file: this.fileName
File name of drawing file: this.document.getFileName()
Layer name of current layer:
var entity = this.getEntity();
var layerId = entity.getLayerId();
var layer = this.document.queryLayer(layerId);
var layerName = layer.getName();

Re: comma as decimal separator in cnc code

Posted: Mon Nov 30, 2015 10:15 pm
by olly
Andrew thanks for your hints
one Step is to go

this.writeLine("BEGIN PGM "+this.document.getFileName()+"MM");
here I got NullString

this.writeLine("BEGIN PGM "+this.fileName+"MM");
here the complete path will be returned

OSX 10.11

Re: comma as decimal separator in cnc code

Posted: Tue Dec 01, 2015 8:27 am
by andrew
olly wrote:this.writeLine("BEGIN PGM "+this.document.getFileName()+"MM");
here I got NullString
This would indicate that the drawing has not been saved and therefore does not have a file name.
this.writeLine("BEGIN PGM "+this.fileName+"MM");
here the complete path will be returned
Yes. If you need to get the file name only, use new QFileInfo(this.fileName).fileName().