comma as decimal separator in cnc code
Moderator: andrew
Re: comma as decimal separator in cnc code
Makes sense, yes. Update attached.
Changes:
 always prepare for cutting before defining arc center (CC)
Changes:
 always prepare for cutting before defining arc center (CC)
 Attachments

 Tnc145.js
 (2.76 KiB) Downloaded 678 times
Re: comma as decimal separator in cnc code
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 Z0,300 R0 F30 M
5 L X+0,272 R0 F30 M
6 L Y0,533 R0 F30 M
7 CC X+0,737 Y1,136
8 C X+0,806 Y0,378 DR R0 F30 M
9 CC X+0,745 Y1,018
10 C X+1,206 Y1,467 DR R0 F30 M
11 CC X+0,777 Y1,046
12 C X+0,250 Y1,333 DR R0 F30 M
13 L Z+1,000 R0 F9999 M13 F30
14 L X1,350 R0 F9999 M13
15 L Z0,300 R0 F30 M
16 CC X0,814 Y1,027
17 C X0,817 Y1,644 DR+ R0 F30 M
18 CC X0,817 Y1,122
19 C X0,817 Y0,600 DR+ R0 F30 M
20 CC X0,817 Y0,078
21 C X0,817 Y+0,444 DR+ R0 F30 M
22 CC X0,813 Y0,139
23 C X1,350 Y+0,089 DR+ R0 F30 M
24 L Z+1,000 R0 F9999 M30
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 Z0,300 R0 F30 M
5 L X+0,272 R0 F30 M
6 L Y0,533 R0 F30 M
7 CC X+0,737 Y1,136
8 C X+0,806 Y0,378 DR R0 F30 M
9 CC X+0,745 Y1,018
10 C X+1,206 Y1,467 DR R0 F30 M
11 CC X+0,777 Y1,046
12 C X+0,250 Y1,333 DR R0 F30 M
13 L Z+1,000 R0 F9999 M13 F30
14 L X1,350 R0 F9999 M13
15 L Z0,300 R0 F30 M
16 CC X0,814 Y1,027
17 C X0,817 Y1,644 DR+ R0 F30 M
18 CC X0,817 Y1,122
19 C X0,817 Y0,600 DR+ R0 F30 M
20 CC X0,817 Y0,078
21 C X0,817 Y+0,444 DR+ R0 F30 M
22 CC X0,813 Y0,139
23 C X1,350 Y+0,089 DR+ R0 F30 M
24 L Z+1,000 R0 F9999 M30
 Attachments

 K3353 engraved within 7mm diameter.txt
 (1.69 KiB) Downloaded 721 times

 K3353 engrave works fine.JPG (47.29 KiB) Viewed 20296 times

 35 engrave works fine.JPG (27.18 KiB) Viewed 20298 times
Last edited by peter on Fri Oct 09, 2015 12:26 pm, edited 1 time in total.
Re: comma as decimal separator in cnc code
Can you correct the first 4 lines of the program and post them, so I can update the configuration, thanks.peter wrote:our first move seems to be executed on Z level 0 but should be Z Clear?
Re: comma as decimal separator in cnc code
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 Z0,300 R0 F30 M
5 L X+0,272 R0 F30 M
6 L Y0,533 R0 F30 M
7 CC X+0,737 Y1,136
8 C X+0,806 Y0,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.
2 TOOL CALL 01 Z S 2000
3 L X+1,272 Y+0,400 R0 F9999 M13
4 L Z0,300 R0 F30 M
5 L X+0,272 R0 F30 M
6 L Y0,533 R0 F30 M
7 CC X+0,737 Y1,136
8 C X+0,806 Y0,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
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 Z0,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 Z0,300 R0 F30 M
5 L X+0,272 R0 F30 M
6 L Y0,533 R0 F30 M
7 CC X+0,737 Y1,136
8 C X+0,806 Y0,378 DR R0 F30 M
9 CC X+0,745 Y1,018
10 C X+1,206 Y1,467 DR R0 F30 M
11 CC X+0,777 Y1,046
12 C X+0,250 Y1,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 X1,350 R0 F9999 M13
15 L Z0,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 Z0,300 R0 F30 M
5 L X+0,272 R0 F30 M
6 L Y0,533 R0 F30 M
7 CC X+0,737 Y1,136
8 C X+0,806 Y0,378 DR R0 F30 M
9 CC X+0,745 Y1,018
10 C X+1,206 Y1,467 DR R0 F30 M
11 CC X+0,777 Y1,046
12 C X+0,250 Y1,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 X1,350 R0 F9999 M13
15 L Z0,300 R0 F30 M
Last edited by peter on Mon Oct 12, 2015 11:53 am, edited 1 time in total.
Re: comma as decimal separator in cnc code
OK, great. Thanks for the confirmation.
Re: comma as decimal separator in cnc code
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)
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
OK, update attached.
 Attachments

 Tnc145.js
 (2.79 KiB) Downloaded 682 times
Re: comma as decimal separator in cnc code
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
Add this to your configuration:peter wrote:an other question, for output file extension *.cnc instead of *.nc how to manage, please?
Tnc145.prototype.getFileExtensions = function() { return ["cnc"]; };
 Attachments

 Tnc145.js
 (2.86 KiB) Downloaded 654 times
Re: comma as decimal separator in cnc code
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
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 "CAMLabels" not for the rest! (one complete CADfile) ?
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 CNCfile?
0 BEGIN PGM SCHRIFT MM
1 TOOL CALL "GRAV" Z S2500
4 L Z0,300 R0 F30 M
5 CC X+0,000 Y+0,000
6 C X100,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
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 "CAMLabels" not for the rest! (one complete CADfile) ?
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 CNCfile?
0 BEGIN PGM SCHRIFT MM
1 TOOL CALL "GRAV" Z S2500
4 L Z0,300 R0 F30 M
5 CC X+0,000 Y+0,000
6 C X100,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
Yes, simply hide those layers in the layer list (eye icon) before exporting to CAM.olly wrote:Is it possible to disable layers, in my case useful for "CAMLabels" not for the rest! (one complete CADfile) ?
Quotes have to be escaped in JavaScript strings:olly wrote:TOOL CALL with "GRAV" (comes from a Tool table) corrupts the script !
Solution for inserting " ?
this.writeLine("TOOL CALL \"GRAV\" Z S2500");
File name of exported file: this.fileNameis 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 CNCfile?
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
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
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
This would indicate that the drawing has not been saved and therefore does not have a file name.olly wrote:this.writeLine("BEGIN PGM "+this.document.getFileName()+"MM");
here I got NullString
Yes. If you need to get the file name only, use new QFileInfo(this.fileName).fileName().this.writeLine("BEGIN PGM "+this.fileName+"MM");
here the complete path will be returned