Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Variables Punched to .DAT file Fanuc 16i control


Adam123
 Share

Recommended Posts

Hi Guys, it's been a long time. I hope this is the right spot. I couldn't find any related topics.

 

I've developed a nice little Timer macro that generates cycle time info automatically. My problem is that I'd like to punch the variable values out at the end of a run but the values come out like this...

 

Capture.png

 

What (if anything) can I do to get it to simply punch the value seen on the control? Thanks in advance!

 

 

Link to comment
Share on other sites

Here are the macros themselves, if anyone is interested...

 

O8301(TIMER/COUNTER INITIATE/RESET)
IF[#780NE0]GOTO780 
#780=#3011(DATE) 
#781=#3012(TIME)
#800=-3.(COUNTER)
#801=0
#802=0
#803=0
#804=0
#805=0
#806=0
#807=0
#808=0
#809=0
#810=0
#811=0
#812=0
#813=0
#814=0
#815=0
#816=0
#817=0
#818=0
#819=0
#820=0
#821=0
#822=0
#823=0
#824=0
#825=0
#826=0
#827=0
#828=0
#829=0
#830=0
#831=0
#832=0
#833=0
#834=0
#835=0
#836=0
#837=0
#838=0
#839=0
#840=0
#841=0
#842=0
#843=0
#844=0
#845=0
#846=0
#847=0
#848=0
#849=0
#850=0
#851=0
#852=0
#853=0
#854=0
#855=0
#856=0
#857=0
#858=0
#859=0
#860=0
#861=0
#862=0
#863=0
#864=0
#865=0
#866=0
#867=0
#868=0
#869=0
#870=0
#871=0
#872=0
#873=0
#874=0
#875=0
#876=0
#877=0
#878=0
#879=0
#880=0
#881=0
#882=0
#883=0
#884=0
#885=0
#886=0
#887=0
#888=0
#889=0
#890=0
#891=0
#892=0
#893=0
#894=0
#895=0
#896=0
#897=0
#898=0
#899=0
N780 
#3001=0(RESET MILLISECOND TIMER) 
M99
 
O8302(TIMER/COUNTER CAPTURE) 
IF[#532EQ0]GOTO532 
IF[#1000EQ1]GOTO2
#1=[#3001/60000](P1 OP1 MILLISECONDS)
#164=#3011(DATE) 
#165=#3012(TIME) 
#166=[#601+#602+#603+#604+#605+#606+#607+#608+#609]
#167=[#1/#166](PER PIECE CYCLE TIME) 
#168=1111.1111(PALLET NUMBER)
#782=[#782+#601+#602+#603+#604+#605+#606+#607+#608+#609] 
#783=[#166*#167+#783]
#787=[#783/#782]
#800=[#800+3.](COUNTER)
IF[#800GT197]GOTO532
#[#800+800.]=#164
#[#800+801.]=#165
#[#800+802.]=[[#166*1000.]+#167]
GOTO532
N2 
#1=[#3001/60000](P1 OP1 MILLISECONDS)
#172=#3011(DATE) 
#173=#3012(TIME) 
#174=[#651+#652+#653+#654+#655+#656+#657+#658+#659]
#175=[#1/#174](PER PIECE CYCLE TIME) 
#176=2222.2222(PALLET NUMBER)
#782=[#782+#651+#652+#653+#654+#655+#656+#657+#658+#659] 
#783=[#174*#175+#783]
#787=[#783/#782]
#800=[#800+3.](COUNTER)
IF[#800GT197]GOTO532
#[#800+800.]=#172
#[#800+801.]=#173
#[#800+802.]=[[#174*1000.]+#175]
N532M99
%
Link to comment
Share on other sites

Hi vortex, I was playing around with DPRNT the other day. I would use it but for whatever reason I could only get it to report two digits left of the decimal point. Regardless of what's in the variable say:

 

4321.1234

 

It would only give the value:

 

21.1234

 

Is this a parameter maybe??

Link to comment
Share on other sites

A little late but for those still unsure about reading Custom MACRO B and DPRINT;

 

[44] = Formatting the output to be four decimal places to the left and four decimal places to the right.

 

[22] would be two and two.

Link to comment
Share on other sites

Thanks, Foghorn. I had one of those awesome epiphanies when reading vortx comment. In addition, it looks like the total value of those numbers can't exceed 8, at least not on my 16i controls, correct? It gives a 'data overflow' error. I'm going to post my DPRNT program, as soon as it's done.

 

A little note of Hazard. My programs above have a couple minor mistakes I fixed on Saturday. Not sure if anybody had the passion to actually read them or not.

Link to comment
Share on other sites

Alright, here are the functional programs...

 

Run this subprogram at cycle start...

 

%

O8301(TIMER/COUNTER INITIATE/RESET)
IF[#780NE0]GOTO780 
#780=#3011(DATE) 
#781=#3012(TIME)
#800=-3.(COUNTER)
#801=0
#802=0
#803=0
#804=0
#805=0
#806=0
#807=0
#808=0
#809=0
#810=0
#811=0
#812=0
#813=0
#814=0
#815=0
#816=0
#817=0
#818=0
#819=0
#820=0
#821=0
#822=0
#823=0
#824=0
#825=0
#826=0
#827=0
#828=0
#829=0
#830=0
#831=0
#832=0
#833=0
#834=0
#835=0
#836=0
#837=0
#838=0
#839=0
#840=0
#841=0
#842=0
#843=0
#844=0
#845=0
#846=0
#847=0
#848=0
#849=0
#850=0
#851=0
#852=0
#853=0
#854=0
#855=0
#856=0
#857=0
#858=0
#859=0
#860=0
#861=0
#862=0
#863=0
#864=0
#865=0
#866=0
#867=0
#868=0
#869=0
#870=0
#871=0
#872=0
#873=0
#874=0
#875=0
#876=0
#877=0
#878=0
#879=0
#880=0
#881=0
#882=0
#883=0
#884=0
#885=0
#886=0
#887=0
#888=0
#889=0
#890=0
#891=0
#892=0
#893=0
#894=0
#895=0
#896=0
#897=0
#898=0
#899=0
N780 
#3001=0(RESET MILLISECOND TIMER) 
M99
%
 
Run this subprogram when the cycle completes and before a pallet change or M30 or M99...
 
%
O8302(TIMER/COUNTER CAPTURE) 
IF[#532EQ0]GOTO532 
IF[#1000EQ1]GOTO2
#1=[#3001/60000](P1 OP1 MILLISECONDS)
#164=#3011(DATE) 
#165=#3012(TIME) 
#166=[#601+#602+#603+#604+#605+#606+#607+#608+#609]
#167=[#1/#166](PER PIECE CYCLE TIME) 
#168=1111.1111(PALLET NUMBER)
#782=[#782+#601+#602+#603+#604+#605+#606+#607+#608+#609] 
#783=[#166*#167+#783]
#787=[#783/#782]
#800=[#800+3.](COUNTER)
IF[#800GT197.]GOTO532
#[#800+801]=#164 
#[#800+802]=#165 
#[#800+803]=[[#166*1000.]+#167]
GOTO532
N2 
#1=[#3001/60000](P1 OP1 MILLISECONDS)
#172=#3011(DATE) 
#173=#3012(TIME) 
#174=[#651+#652+#653+#654+#655+#656+#657+#658+#659]
#175=[#1/#174](PER PIECE CYCLE TIME) 
#176=2222.2222(PALLET NUMBER)
#782=[#782+#651+#652+#653+#654+#655+#656+#657+#658+#659] 
#783=[#174*#175+#783]
#787=[#783/#782]
#800=[#800+3.](COUNTER)
IF[#800GT197.]GOTO532
#[#800+801]=#172 
#[#800+802]=#173 
#[#800+803]=[[#174*1000.]+#175]
N532M99
%

 

Run the DPRNT when the job is done. It prints all the data and resets for the next job....

 

%
O8303(DPRNT TIMER DATA)
#1=#3011(DATE)
#2=#3012(TIME)
#3=0
 
POPEN
 
DPRNT[MACHINE*NUMBER*#699[44]]
DPRNT[PROGRAM*NUMBER*#798[44]]
 
DPRNT[sTART*DATE*#780[80]]
DPRNT[sTART*TIME*#781[80]]
 
DPRNT[PRINT*DATE*#1[80]]
DPRNT[PRINT*TIME*#2[80]]
 
DPRNT[TOTAL*PARTS*#782[80]]
DPRNT[AVERAGE*CYCLETIME*#787[42]]
 
WHILE[#[#3+801]GT0]DO1
#4=[[#3/3]+1]
DPRNT[RUN#4[80]*DATE*#[#3+801][80]]
DPRNT[RUN#4[80]*TIME**#[#3+802][80]]
DPRNT[RUN#4[80]*CYCLETIME***#[#3+803][80]]
#3=#3+3
END1
 
PCLOS
 
#780=0
#781=0
#782=0
#783=0
M30
%
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...