Modified your code. Altered all the 'L's to N1 and added G01 and this is the result.
Im not sure what program is best to simulate my code.
Please see the attachemts.
The file extension is .H but i renamed it to txt.
I have built a program from scratch using visual basic .NET. where the
output would be the CNC code.
I tried using the free CNC Simulator but im still having difficulties with.
Any help would be appreciated. Thanx in advance.
Modified your code. Altered all the 'L's to N1 and added G01 and this is the result.
WOW !!! THANX ..
Man may you post the modified code and may you please tell me what software your using to show the preview ?
Free DXF Files - myDXF.blogspot.com
Thanx Man. I still want to know what software kiwi used. His drawing shows the origin (x,y) . Which i like. If you know what program he ued please let me know.
I used BobCADCAM V20.
As I use a FAGOR controller I altered to the required format by using MSword;
N1 G01 X-30.938 Y-160
N1 X-22.987 Y-160
N1 X-22.444 Y-159.986
N1 X-22.131 Y-159.969
N1 X-21.862 Y-159.95
N1 X-21.614 Y-159.929
N1 X-21.381 Y-159.907
N1 X-21.158 Y-159.884
Thanx man, I downloaded the software.
I opened my file and used. moved the header part (First six lines) to a text file (Cut - Paste) so that [The word Tool & call wont be affected].
Then used the find and replace feature: Find"L(space)" Replace with "(space) (space)". Then pasted back what i cut.Then in the bobcam editor window i hit on Edit > Renumber ,then added in the G01 Manually.
I can see youve used N1 All the way along have u used it at the very begining as well ? Anyways heres my modfied code is it correct this way ? BTW how do i run a simulation ?
N1 BEGIN PGM NNT MM
N2 BLK FORM 0.1 Z X+100 Y+100 Z+0
N3 BLK FORM 0.2 X+200 Y+200 Z+100
N4 TOOL DEF 1 L+0 R+10
N5 TOOL CALL 1 Z S1 F1
N6 M6
N7 X+89 Y+89 Z+101 F1 M3
N8 X+201 F1
N9 Y-160
N10 Z-1
N11 G01 X-30.938 Y-160
N12 X-22.987 Y-160
N13 X-22.444 Y-159.986
N14 X-22.131 Y-159.969
I deleted all the lines down to your main code line N11. Didn't examine them for errors.
I could have just deleted the L instead of converting to a line number (N????)
To simulate :Edit/Select All...........Edit/Geometry from NC
The first 5 lines will vary, depending on the controller.
For lines with comments my FAGOR controller requires a ';' where others use '('
Using line numbers (N????) is optional.
Thanx for your reply man, I have one question regarding the Workpiece.
Quick Intro:-
I have built a Spur gear Calculator program using Visual Basic .NET
Now Basically this window is under CNC code.
The highlighted items show the dimensions of the workpiece.
Now if im to draw my gear using BobCAD-CAM where should the fixture holding the workpiece be located at ?
Please see the attachments for the code.
This code is different from the one i posted earlier.
You have done well with your calculator. Does it calculate a involute path?
I'm thinking a 3 axis vertical mill.
I would think the centre of the gear would be the origin X0 Y0 and the piece would be held with a bolt at this point or held with a vice or lathe chuck which is fixed to the table.
This program is specifically for spur gears calculations.
![]()
Now Basically what i want to do is tie the input machining parameters with the offset i got(Tool path CNC Code - see picture below).
The purpose of that is to move the centre of the gear to the centre of the workpiece.
Regarding the same input parameters that i input back in post # 10 this
would be my output (not the tool path generated).
.
So basically from the above picture you can see that when i apply both both new offset equations for the gear the values of a=b=0 on the other hand when i apply them for the pinion the value of a = (Distance Centre; Distance from the centre of the gear to the centre of the pinion), and b=0.
Moving to the CNC Window:
Hitting the OK button:
And now this is how i managed to write the first couple of lines my CNC Code header. *Note the values used in the machining parameters in the following pictures are different from the one ive been taking pictures of.
I could have used my old CNC code the one showing here:
But as i mentioned i want to do the translation so that after the code is saved from my program all i have to do is upload and run program. Any help is welcomed.