Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

insertts G codes in the program

daunong12

New member
Hi all,


I'd like to insert some G code in the begining of the tool and the end of the program, but I don't know how. Please help


thank you
 
If using WF3, you can create a Custom CL Command for the tool that will be called at the tool change.


Alternatively, you can create an AUXILARY sequence and go into Customize and do CL COMMAND.


For example to turn on the coolant:


INSERT/M08
 
You can insert a command in the CL file for a one time or special situation. After you have created a sequence go to Customize, pull down CL command and hit insert. Use caution, sometimes results are un predictable but it can be done.


Assuming this is something that you always need then you should ad it to the FILfile of your post. Below is some example code. Your code will be different depending on your application. This first example will insert some operator information then when the N number sequence begins it will insert number lines with M25 M21, G0 X20. Z20. and G50 S6000. There is actually aPARTNO macro before that in the post that prompts the programmer for some of the data in this macro but G code should be in MACHIN.


CIMFIL/ON,MACHIN
XX=POSTF(13)
TIME = TEXT/TIMES $$ GET THE CURRENT CPU TIME AND DATE
seqno/off&nb sp; $$turn off the sequence numbers
insert/'(TDC work order number: ',wornm,')$'
insert/'(Pro MFG file name: ',prtno,')$'
insert/'(Code file processed @ ',TIME,')$'
insert/'(Programmed for Okuma ES L6 lathe)$'
insert/'(Units=INCH Feed=INCH/REV)$'
insert/'(Programmer=',prgnm,')$'
seqno/on $$turn sequence numbers back on
insert/' M25 M21$'
insert/' G0 X20. Z20.$'
insert/' G50 S6000$'
CIMFIL/OFF


The example below will place code at the end of a program. In this example G01 X75. Y50. Z100. R, G49 R and M30 will be insertedas the last three lines of code.


CIMFIL/ON, FINI $$ Macro starts on FINI
XX=POSTF(20)$$ save the FINI record in memory
INSERT/' G01 X75. Y50. Z100. R$'
INSERT/' G49 R$'
INSERT/' M30$'
XX=POSTF(21)$$ restore the FINI record saved in memory
XX=POSTF(13)$$ Process the CL record
CIMFIL/OFF$$ End of CIMFIL on FINI


I caution again your code will be different. These are examples from two different post that do work. The green text is just programming notes an are not needed in the actual code.


Good luck.
 
HI
Edit the post processor this way and add some user defind start and end blocks

go to applications,nc post processor nd select post open it.

go to start and end programme,check the boxes of output user defind startup blocks and output user defind end programme blocks blocks.

now those 2 menus will be added on top.

click on fist and enter the number of lines u want those many colums will be added.

type the startup commands u want to add

repeat same for end programme also .
try this
 
dibz said:
HI
Edit the post processor this way and add some user defind start and end blocks

go to applications,nc post processor nd select post open it.

go to start and end programme,check the boxes of output user defind startup blocks and output user defind end programme blocks blocks.

now those 2 menus will be added on top.

click on fist and enter the number of lines u want those many colums will be added.

type the startup commands u want to add

repeat same for end programme also .
try this




Yes I've tried that, but the codes insert abovePROGRAM NUMBER and after M30. How to fix that?


thank you
 
%
N2G00
N4G17G40G49G80G90
N6G0Z50G54
N8( / DATE TIME : 12-SEP-06 12:00:31)
N10( / TOOL NAME : T5)
N12( / TOOL_TYPE : BALL MILL)
N14( / CUTTER DIAMETER, 6.00)
N16M00T5
N18M03S5000
N20G01X-42.Y-69.916Z10.F9999
N22Z-34.261
N24Z-35.261F60
N26Y-67.479Z-35.923F1000
N572Z-12.186F60
N574Y72.374Z-45.549F1000
N576Z10.F9999
N578M05
N580G90G0Z50
N582M30
%
Hi see this fanuc millimeter programme, i have deleted some blocks from the middle to shorten it,
the green colour blocks are user defined ones.
and also check ur post processors format in mcd file format while editing the post processor
 

Sponsor

Articles From 3DCAD World

Back
Top