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:

Outputting Probing Results using Custom Macro


Mick
 Share

Recommended Posts

Hi there,

 

We have a Toyoda FMS (2 x 1050s), and I want to somehow output the probing results into a file.

 

Is there any way of doing this? I'm quite new to custom macros so please be gentle. :)

 

I'd like to output a file, and have catergories like this:

 

(X AXIS MEASUREMENT)

112.54

 

(Y AXIS MEASUREMENT)

23.433

 

etc etc.

 

Is this doable at all?

 

Cheers,

 

Mike

  • Like 1
Link to comment
Share on other sites

There are a few ways to do it using DPRINT. Do you have the Renishaw Inspection Plus macros? Those will output them for you automatically. Just add a W1. at the end of each macro call.

 

I've had machines that will just write the Renishaw output to the hard drive for the last 6 or 7 years, so it's been a long time since I had to play with the DPRINT function. The Fanuc manual has a pretty good explanation of it. You can output just about anything you want.

Link to comment
Share on other sites

Ok, the manual mentions dprint, and I understand how the output works.

 

It doesn't mention anything about specifing a filename though. Is this possible?

 

Are you going through RS232 to a serial communication program like Cimco? I used to set Cimco to "Receive into new window", and then I could save the thing with whatever name I wanted after it was done. I don't know if there's a way to have it output a specific file name.

Link to comment
Share on other sites
Guest CNC Apps Guy 1

Here's a sample I always give to ym customers;

 

%

O7777(31i SERIES CONTROL DPRINT TEST)

G90G10L52

N20R4(CHANGE TO FLASH CARD)

G11

 

(0 and 1 = RS232)

(4 = CARD)

(5 = DATASERVER)

 

G4X5.

 

(DATA BELOW IS CAPTURED IMMEDIATELY AFTER A PROBING)

#135=5.8895 (X POSITION)

#136=.0003 (Y POSITION)

#137=.0 (Z POSITION)

#138=1.7507 (SIZE)

#139=.0 (X SURFACE ANGLE/4TH ANGLE/ANGLE)

#140=.0005 (X ERROR)

#141=.0007 (Y ERROR)

#142=.0 (Z ERROR/Y SURF ANGLE)

#143=.0007 (SIZE ERROR)

#144=.0 (X ANGLE ERROR/ERROR)

#145=.00172 (TRUE POS. ERROR)

#146=0. (METAL CONDITION)

#147=0. (DIRECTION INDICATOR)

#148=0. (OUT OF TOLERANCE FLAG 1-7)

#149=0. (PROBE ERROR FLAG)

 

(PROGRAM TO FORMAT AND OUTPUT CAPTURED DATA)

( * IS TREATED AS A SPACE)

(24 IS FORMATTING NUMERICAL THE OUTPUT - )

( - 2 PLACES BEEFORE THE DECIMAL AND 4 PLACES AFTER)

N100 POPEN (OPEN COMM CHANNEL)

N135 DPRNT[X*POSITION*IS*#135[24]]

N136 DPRNT[Y*POSITION*IS*#136[24]]

N137 DPRNT[Z*POSITION*#137[24]]

N138 DPRNT[DIAMETER/SIZE*#138[24]]

N139 DPRNT[X*SURFACE*ANGLE/4TH*ANGLE/ANGLE*#139[24]]

N140 DPRNT[X*ERROR*#140[24]]

N141 DPRNT[Y*ERROR*#141[24]]

N142 DPRNT[Z*ERROR/Y*SURF*ANGLE*#142[24]]

N143 DPRNT[size*ERROR*#143[24]]

N144 DPRNT[X*ANGLE*ERROR/ERROR*#144[24]]

N145 DPRNT[TRUE*POS.*ERROR*#145[24]]

N146 DPRNT[METAL*CONDITION*#146[24]]

N147 DPRNT[DIRECTION*INDICATOR*#147[24]]

N148 DPRNT[OUT*OF*TOLERANCE*FLAG*1-7*#148[24]]

N149 DPRNT[PROBE*ERROR*FLAG*0-2*#149[24]]

N200 PCLOS (CLOSE COMM CHANNEL)

 

G90G10L52

N20R5(CHANGE IO TO DATASERVER)

G11

G4X5.

 

M30

%

 

HTH

 

Drop a card in the slot and away you go. It will automatically create the files. (PRNT0000.DAT and start incrementing up from there) You have no control over their naming according to my contact at FANUC.

 

 

 

 

Link to comment
Share on other sites

Thanks very much for that. That is exactly what I need.

 

I did manage to get it to output data to the card all by myself :)

 

And thanks for answering the question about the naming. That is a shame that there is no control over the name output. Interestingly, the name output was MCR_PRNT.TXT, but it didn't renumber incrementally. It just errored up saying "file already exists"

 

Is there any way to change to number the files incrementally, and also change the output channel to use the ethernet, so it can be uploaded to the Cell Controller?

 

Thanks everyone for your help so far.

Link to comment
Share on other sites

Ok, I've got the time and date output sorted :)

 

Edit: Well, no, I didn't. I get a format error when I try to output #3011 and #3012, which according to the manual can be used to read the current date (#3011) and time (#3012).

Link to comment
Share on other sites
Guest CNC Apps Guy 1
Thanks very much for that. That is exactly what I need.

Nothing but the best for my friends, :cheers:

 

 

 

Ok,

 

For the date, I'm pretty sure you need to capture the #3011 and #3012 to Local Variables first, (ex. #161 and #162), then get them out that way.

 

POPEN and PCLOSE should initiate a new file. You running a 31i Control on your Yoda's? I'll have to check the manual in the morning to see if there's a parameter governing that. I know you can;t rename them, but you should get them incremented up.

 

Ethernet... perhaps. I've never tried it. Ethernet is Channel 9 IIRC.

 

HTH

Link to comment
Share on other sites
Guest CNC Apps Guy 1

Try putting a PCLOS, then POPEN at the beginning of the program, then close it out at the end. I'm looking at some other probing stuff I have and in the Renishaw AxiSet software, it does that. But the fact that it does not give yo ua number in the file name is definitely not what I would expect.

 

One thing that may be related, #3301.7 (you may see sn HDC above it, maybe not). This allows you to press and hold the shift button down for like 5 seconds and it will capture a screen shot to your open channel (usually 4, it does not work with 5). Why this may be relevant is because you can capture screen shots and it increments the file number up. Give that a shop.

Link to comment
Share on other sites

Thanks for the further info James. I'm now at home (being that I am down here in the Southern Hemisphere :) ), so I will try this info in the morning. As I was driving home, I had a thought that maybe I needed to capture the date parameters to local variables. I'll also try the ethernet channel output, and see what happens.

 

I'll let you know what I find out.

 

Yes, we're 31i's on our Yodas.

Link to comment
Share on other sites
Guest CNC Apps Guy 1

16i Format;

 

G90G10L50

N20R4

G11

 

As far as writing a file to the Dataserver... not absolutely sure. I've not tested it. But getting a file from the Dataserver to a PC is done via FTP (over a network usually), if connected directly to a PC, you'll need the ORANGE (Crossover) network cable.

Link to comment
Share on other sites
  • 4 years later...

I hope someone can help on this. I'm trying to write a DPRNT routine with DO/WHILE or GOTO loops. I'm trying get the output statement to auto increment.

 

I want output to look like this:

 

  PROG:       7781
  DATE:   20160128
  TIME:   160936
  V100       .00000 
  V101      1.00000 
  V102      2.00000 
  V103       .00000
  V104       .00000 
  V105      1.00000 
  V106      2.00000 
  V107       .00000

 

So I'm attempting to us a GOTO loop ( I had a DO/WHILE in the original, but thought it might be causing the failure so I switched to a loop). I would like to output the description V101,V102,V103.... using a variable. I can do it with the individual statements under the ( # TEST TEMP)  section, but can't crack this nut. I also change the description variable to #143 thinking the same # being called 2x, but sadly no. 

 

 

Any thoughts?

 

 

#141=#4(DATA TRANSFER START #) 
#142=#5(DATA TRANSFER END #) 
#143=#141
 
POPEN
 
(CAPTURE PROGRAM INFO) 
DPRNT[**PROG:**#4115[80]]
(CAPTURE DATE & TIME)
DPRNT[**DATE:**#3011[80]]
DPRNT[**TIME:**#3012[60]]
 
( # TEST TEMP) 
DPRNT[**V100**#100[45]]
DPRNT[**V101**#101[45]]
DPRNT[**V101**#102[45]]
 
N10( LOOP START) 
 
(CHECK LOOP COUNT-COMPLETE)
IF[#141GT#142]GOTO99 
 
DPRNT[**V#143**#141[45]] 
 
#141=#141+1(+1 TO COUNTER) 
#143=#141
 
(CHECK LOOP COUNT-COMPLETE)
IF[#141LT#142]GOTO10 
 
N99
 
PCLOS
Link to comment
Share on other sites

Off Track:

Hey Mike, hope all is well. Let me know your plans and we can try to meet up when you are in town.

 

On Track:

I re-ran the macro and I'm receiving a PS1143 BPRNT/DPRNT STATEMENT FORMAT ERROR Description in the book: "The format used in the BPRINT statement or DPRINT statement is in error" Not much help. 

 

DPRNT output file is:

 PROG:       7781
  DATE:   20160128
  TIME:   160936
  V100       .00000 
  V101      1.00000 
  V101      2.00000 
 
Fails at the looping section. 
 
Any ideas are welcome.
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...