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.

sub program

leow_john

New member
Hi all

How I could I create a sub program using Pro-NC
I mean using M98, M98

Is it fully controlled by GPOST or else any setting inside Pro-NC?

Regards

Leow
 
I am assuming your refering to Fanuc Macro "B".


The sub program is called with a M98 or a G65 and ends with a M99. If you call the subprogram with a G65 you can pass data into the subprogram. See your Fanuc manual.


If you use 9000 program numbers there editing can be restricted.


GPOST has nothing to do with a Macro B subprogram.


I write the subprograms manually. If you will give an e-mail address I'll send you some samples.
 
Leow not having pro/nc here at home... and not having used it in awhile, use mastercam most of the time.


you create you nc sequence then under cl data there should be a subroutines menu off the machining menu, they you cancheck the ones you want to sub or all of them...done sel


then you get more options..fixture offsets,absolute/ incremental and more menus picks etc. redefine... pat def


it's there somewhere..where depend of which flavor of pro/man


I wrote a vb program to manage this.
 
Hi Mr. Wsylvester

Thanks for spending your time.

I tried this method earlier but not good like master cam.


Sub routinesin pro-e helps just changing to G91 only


Any idea to get sub Programe call
 
Not a problem leow_john


I will check at work tomorrow and try and get back to you this weekend if someone else does not get back to you about this. LIke I said I am more mastercam than pro/man....


I work nights ... that why I am up late now...but need to get to sleep real soon it's 2:35 am and I am fading fast


I'm glad you brought this up as I had a bunch of tutorials that a ptc person sent me and thought I might of deleted them...75megs zipped , it will take some time to look through them again.


I think that someone else will have a answer for you sooner than I will..it's a good forum with some great people
 
Leow,


Here is what I use for sub Programs in pro nc!


CIMFIL/ON,DEFSUB
SUBNUM=POSTF(7,4)
TPNUM=TEXT/'O',CONVF,SUBNUM,4,0,0,1,1,'$'
INSERT/TPNUM
CIMFIL/OFF


CIMFIL/ON,ENDSUB
INSERT/'M99$'
INSERT/' $'
CIMFIL/OFF


CIMFIL/ON,CALSUB
CNUM=POSTF(7,4)
TPNUM=TEXT/'M98P',CONVF,CNUM,4,0,0,1,3,'$'
INSERT/TPNUM
CIMFIL/OFF
 
basically the same thing with comments
1. <B style="mso-bidi-font-weight: normal">CIMFIL/ON,DEFSUB $$ starts on all DEFSUB records
SUBNUM=POSTF(7,4) $$ first parameter of the DEFSUB command
$$ Convert the scalar SUBNUM to a string [/B]<B style="mso-bidi-font-weight: normal">O [/B]<B style="mso-bidi-font-weight: normal">followed by 4 digits[/B]
<B style="mso-bidi-font-weight: normal">TPNUM=TEXT/
 
Leow -
So, in FIL, the POSTF functions allow the programmer to do different things in the code. There are several types of functions that can be used. The general format of the functions is as follows:

variable = POSTF(function, argument#, argument#+1, argumentn)

Specifically, POSTF(7,4) tells the post to read the CL word value stored in the forth record location.
An example to clarify:

CIMFIL/ON,PIERCE
WRD4 = POSTF(7,4)&n bsp;&n bsp; $$ get first minor parameter
IF (WRD4 .EQ. (ICODEF(OFF))) THEN
$$ INSERT/'(<< CALL THE LASER-OFF SUBPROGRAM HERE >>)$'
INSERT/'G918$'
.
.
.


Examples of possible ncl data that could be generated by Pro/E, and handled in the above FIL code section:
PIERCE / ON, CONST, WATTS, 1200.000000
-or-
PIERCE / OFF


this is an instance of reading the cl data, looking for the pierce statement, then using POSTF(7,4) to look at the forth word (ON or OFF), and then branching from there.

Hope that helps to clarify a bit.

Regards-
-tsl
 
Todd,


The company I work for has been having post issues. I checked the link on your profile and see that you're sort of in our neck of the woods..... a little colder perhaps
smiley2.gif



This won't happen overnight, they drag their feet in a big way and our my guy just had surgery... PM with details if interested.


Bill
 

Sponsor

Articles From 3DCAD World

Back
Top