cncappsjames

FANUC DPRNT - Outputting Comments to your I/O Channel

Recommended Posts

Was communicating the other day with someone and the question was posed about a probing scenario and they wanted to output the probing data in a certain way. So we went through the data they wanted, how they wanted to see it and I thought back over the years and we've had similar questions have com up. Figured I'd share.

The asterisks (*) in the DPRNT statements will output a space in the output file. the numbers in square brackets ([24]) means 2 decimal place to the left and 4 decimal places to the right.

N1T1M06
G5.1Q0
M132
G90G54B0C0
G54.4P1
G68.2X0Y0Z0I0J0K0
G53.1
M131
G43H#517

G90G10L52 (WRITING TO PARAMETERS)
N20R17 (CHANGE TO USB)
G11 (FINISH WRITING TO PARAMETERS)

G65P9832
POPEN (OPEN I/O CHANNEL)
G65P9810X5.8895Y0F200.
G65P9810Z3.0F120.
G65P981-Z.25.F80.
G65P9814D1.750
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]]
N140 DPRNT[X*ERROR*********#140[24]]
N141 DPRNT[Y*ERROR*********#141[24]]
N143 DPRNT[SIZE*ERROR*******#143[24]]
N145 DPRNT[TRUE*POS.*ERROR*#145[24]]
PCLOS(CLOSE I/O CHANNEL)

G90G10L52 (WRITING TO PARAMETERS)
N20R5 (CHANGE IO TO DATASERVER)
G11 (FINISH WRITING TO PARAMETERS)

M01
%

The file (usually a *.DAT file but can/is determined by parameter) will output what you see below.

X POSITION IS          5.8895
Y POSITION IS          .0003
Z POSITION              -.2500
DIAMETER/SIZE       1.7507
X ERROR                    .0005
Y ERROR                    .0007
SIZE ERROR               .0007
TRUE POS. ERROR    .0017

 

Hope this opens up some possibilities or discussions for you.

  • Like 5

Share this post


Link to post
Share on other sites

Here's a little snippet of an probing inspection program...

O4242
 (4" LONG OMP400 PROBE INSPECTION PALLET A)
IF[#153EQ#0]GOTO1
N32770 G00 G90 X30.1239 Y17.1176 (B0.) M19
N32780 G43 H04 Z4.5
N32790 G65 P9810 Z3.8 F200.
N32800 G65 P9814 D1.03
N32810 #5301=[[#135+#[[[#4130*20]-20]+7001]]+[1.8865]]
N32820 #5302=[[#136+#[[[#4130*20]-20]+7002]]+[-1.4216]]
N32830 G65 P9810 Z4.5 F200.
N32840 Y18.8676
N32850 G65 P9810 Z4.25 F200.
N32860 G65 P9811 Z3.75
N32870 #5303=[[#137+#[[[#4130*20]-20]+7003]]+[-4.]]
N32880 G65 P9810 Z4.5 F200.
N32890 #[6981+[[#181+1.]*20]]=#5301
N32900 #[6982+[[#181+1.]*20]]=#5302
N32910 #[6983+[[#181+1.]*20]]=#5303
N32920 #[6984+[[#181+1.]*20]]=#[6984+[#181*20]]
 (1.030*DIA*THRU*SHEET*3)
N32930 #900=#181+1
N32940 X-1.8865 Y1.4216 Z4.5 G54 P[#900]
N32950 G65 P9810 Z3.8 F200.
N32960 G65 P9814 D1.03
N32970 G65 P9810 Z4.5 F200.
POPEN
DPRNT[]
DPRNT[-----------------------------------------------------------]
DPRNT[***1.030*DIA*THRU*SHEET*3***]
DPRNT[X-1.8865*Y1.4216*DIA*1.03*TOL*+/-*.005***]
DPRNT[***RESULTS***X#135[24]*Y#136[24]*DIA*#138[24]]
DPRNT[-----------------------------------------------------------]
DPRNT[]

 (1.25*DIA*LOWER*BOSS*SHEET*3)
N0210 X-10.2018 Y4.961
N0220 G65 P9810 Z4.5 F200.
N0230 G65 P9814 Z3.8 D1.25 R.25
N0240 G65 P9810 Z4.5 F200.
DPRNT[]
DPRNT[-----------------------------------------------------------]
DPRNT[***1.25*DIA*LOWER*BOSS*SHEET*3***]
DPRNT[X-10.2018*Y4.961*DIA*1.25*TOL*+/-*.002***]
DPRNT[***RESULTS***X#135[24]*Y#136[24]*DIA*#138[24]]
DPRNT[-----------------------------------------------------------]
DPRNT[]
 (1.25*DIA*UPPER*BOSS*SHEET*3)
N0250 X-9.0995 Y6.8449
N0260 G65 P9810 Z4.5 F200.
N0270 G65 P9814 Z3.8 D1.25 R.25
N0280 G65 P9810 Z4.5 F200.
DPRNT[]
DPRNT[-----------------------------------------------------------]
DPRNT[***1.25*DIA*UPPER*BOSS*SHEET*3***]
DPRNT[X-9.0995*Y6.8449*DIA*1.25*TOL*+/-*.002***]
DPRNT[***RESULTS***X#135[24]*Y#136[24]*DIA*#138[24]]
DPRNT[-----------------------------------------------------------]
DPRNT[]

 (.252*DIA*LOWER*POCKET*SHEET*3)
N32980 X-3.686 Y-3.737
N32990 G65 P9810 Z3.45 F200.
N33000 G65 P9814 D.252
N33010 G65 P9810 Z4.5 F200.
DPRNT[]
DPRNT[-----------------------------------------------------------]
DPRNT[***.252*DIA*LOWER*POCKET*SHEET*3***]
DPRNT[X-3.686*Y-3.737*DIA*.252*TOL*+/-*.001***]
DPRNT[***RESULTS***X#135[24]*Y#136[24]*DIA*#138[24]]
DPRNT[-----------------------------------------------------------]
DPRNT[]
 (.252*DIA*UPPER*POCKET*SHEET*3)
N33020 X2.092 Y4.814
N33030 G65 P9810 Z3.45 F200.
N33040 G65 P9814 D.252
N33050 G65 P9810 Z4.5 F200.
DPRNT[]
DPRNT[-----------------------------------------------------------]
DPRNT[***.252*DIA*UPPER*POCKET*SHEET*3***]
DPRNT[X2.092*Y4.814*DIA*.252*TOL*+/-*.001***]
DPRNT[***RESULTS***X#135[24]*Y#136[24]*DIA*#138[24]]
DPRNT[-----------------------------------------------------------]
DPRNT[]
 (FIRST POINT .870 UPPER O-RING SIDE DISTANCE)
N33060 X-7.8232 Y8.035
N33070 G65 P9810 Z3.4 F200.
N33080 G65 P9821 A-137. D.25
N33090 G65 P9810 Z4.5 F200.
N33100 #[940+1]=#135
N33110 #[940+2]=#136
N33120 G65P9834
 (.870*UPPER*O-RING*SIDE*DISTANCE*SHEET*3)
N33130 X-8.4595 Y7.4417
N33140 G65 P9810 Z3.8 F200.
N33150 G65 P9821 A-137. D.25
N33160 G65 P9810 Z4.5 F200.
N33170 #[950+1]=#135
N33180 #[950+2]=#136
N33190 G65 P9834 A-137. D.87
DPRNT[]
DPRNT[-----------------------------------------------------------]
DPRNT[***.870*UPPER*O-RING*SIDE*DISTANCE*SHEET*3***]
DPRNT[***DISTANCE*.87*TOL*+/-*.005***]
DPRNT[***RESULTS***DISTANCE*#138[24]***]
DPRNT[-----------------------------------------------------------]
DPRNT[]
 (FIRST POINT .400 UPPER O-RING FLOOR DISTANCE)
N33200 X-8.8618 Y7.0666
N33210 G65 P9810 Z4.25 F200.
N33220 G65 P9811 Z3.75
N33230 G65 P9810 Z4.5 F200.
N33240 #[940+3]=#137
N33250 G65P9834
 (DEPTH*UPPER*O-RING*FLOOR*1*SHEET*3)
N33260 X-8.4595 Y7.4417
N33270 G65 P9810 Z3.8 F200.
N33280 G65 P9811 Z3.3
N33290 G65 P9810 Z4.5 F200.
N33300 #[950+3]=#137
N33310 G65 P9834 Z-.4
N33320 #961=#137
N33330 #962=#137
POPEN
DPRNT[]
DPRNT[-----------------------------------------------------------]
DPRNT[***DEPTH*UPPER*O-RING*FLOOR*1*SHEET*3***]
DPRNT[***DISTANCE*-.4*TOL*+/-*.001***]
DPRNT[***RESULTS***DISTANCE*#138[24]***]
DPRNT[-----------------------------------------------------------]
DPRNT[]

 

Report...
-----------------------------------------------------------
   1.030 DIA THRU SHEET 3   
X-1.8865 Y1.4216 DIA 1.03 TOL +/- .005   
   RESULTS   X-1.8866 Y1.4213 DIA 1.0243
-----------------------------------------------------------


-----------------------------------------------------------
   1.25 DIA LOWER BOSS SHEET 3   
X-10.2018 Y4.961 DIA 1.25 TOL +/- .002   
   RESULTS   X-10.2011 Y4.9600 DIA 1.2507
-----------------------------------------------------------


-----------------------------------------------------------
   1.25 DIA UPPER BOSS SHEET 3   
X-9.0995 Y6.8449 DIA 1.25 TOL +/- .002   
   RESULTS   X-9.0989 Y6.8439 DIA 1.2506
-----------------------------------------------------------


-----------------------------------------------------------
   .252 DIA LOWER POCKET SHEET 3   
X-3.686 Y-3.737 DIA .252 TOL +/- .001   
   RESULTS   X-3.6861 Y-3.7371 DIA .2514
-----------------------------------------------------------


-----------------------------------------------------------
   .252 DIA UPPER POCKET SHEET 3   
X2.092 Y4.814 DIA .252 TOL +/- .001   
   RESULTS   X2.0917 Y4.8135 DIA .2514
-----------------------------------------------------------


-----------------------------------------------------------
   .870 UPPER O-RING SIDE DISTANCE SHEET 3   
   DISTANCE .87 TOL +/- .005   
   RESULTS   DISTANCE .8704   
-----------------------------------------------------------


-----------------------------------------------------------
   DEPTH UPPER O-RING FLOOR 1 SHEET 3   
   DISTANCE -.4 TOL +/- .001   
   RESULTS   DISTANCE -.3977   
-----------------------------------------------------------


-----------------------------------------------------------
   DEPTH UPPER O-RING FLOOR 2 SHEET 3   
   DISTANCE -.4 TOL +/- .001   
   RESULTS   DISTANCE -.3977   
-----------------------------------------------------------


-----------------------------------------------------------
   DEPTH UPPER O-RING FLOOR 3 SHEET 3   
   DISTANCE -.4 TOL +/- .001   
   RESULTS   DISTANCE -.3968   
-----------------------------------------------------------


-----------------------------------------------------------
   DEPTH UPPER O-RING FLOOR 4 SHEET 3   
   DISTANCE -.4 TOL +/- .001   
   RESULTS   DISTANCE -.3969   
-----------------------------------------------------------


-----------------------------------------------------------
   DEPTH UPPER O-RING FLOOR 5 SHEET 3   
   DISTANCE -.4 TOL +/- .001   
   RESULTS   DISTANCE -.3969   
-----------------------------------------------------------


-----------------------------------------------------------
   DEPTH UPPER O-RING FLOOR 6 SHEET 3   
   DISTANCE -.4 TOL +/- .001   
   RESULTS   DISTANCE -.3968   
-----------------------------------------------------------


-----------------------------------------------------------
   DEPTH UPPER O-RING FLOOR 7 SHEET 3   
   DISTANCE -.4 TOL +/- .001   
   RESULTS   DISTANCE -.3976   
-----------------------------------------------------------


-----------------------------------------------------------
   DEPTH UPPER O-RING FLOOR 8 SHEET 3   
   DISTANCE -.4 TOL +/- .001   
   RESULTS   DISTANCE -.3981   
-----------------------------------------------------------

 

image.png

I don't know how this got in...

 

  • Like 2

Share this post


Link to post
Share on other sites

That's badass @Tim Johnson.

We helped a customer develop a process to ease some of the bottleneck in QC by doing non critical dimension inspection in the machine. I think there were only 30-40 features total IIRC and 5 of them were critical. They knew they could have done it all but their customer was leery of the machine that created the parts was inspecting the parts so they made this compromise. They used a Serialization MACRO on the part and each *.DAT file had the serial number in it so they could trace parts to reports. I remember the initial discussions with the customer "... our machine can do that?". Yessiree! I think I wrote about the same as I wrote up above and they did all the rest. Warmed my heart. :)

  • Like 3

Share this post


Link to post
Share on other sites

Hey eM,

Happy belated holidays. Just getting back into the swing of things.

Your post inspired me to explore these functions. POPEN doesn't work on one machine. It throws an error:

PS 1860 DR off (modem card)

Sifting through the documentation as we speak but if you have any hints they would be much appreciated. The IO channel is set to 17 USB so I was expecting it to save the output to a USB drive.

Share this post


Link to post
Share on other sites

Sorry - it's a Fanuc 30i, and is also a custom whack job. 

I'm not accustomed to this type of controller. It has a built-in Windows PC interface, and appears to be connected to a data server over wifi that doesn't work. It also has some sort of internal DNC interface that is not hard-wired to any external devices. There are no RS-232 ports - only USB ports, and the data server (if that's what it is) seems to be connected to a 'Netgear Genie' dongle.

This company is under massive transformations. We have remote/off-premise IT staff, and out-of-state technicians who don't respond for days or even weeks. They probably don't like bothering with crappy used machinery.

Meanwhile we are loading programs with a USB flash drive. I was hoping to output text files to the flash drive with POPEN and DPRINT.

Share this post


Link to post
Share on other sites

Check parameters #20 (should already be 17), #21, #22, and# 23. They should all be 17.

Share this post


Link to post
Share on other sites

Yeah still the same error when 20 - 23 are changed to 17.

PS 1860 DR off (modem card)

Just for kicks I tried setting all of them to the memory card channel #4 and got a different alarm:

PS 1961 MEMORY CARD NOT READY

Just by random chance I discovered the data server - it's definitely connected over wifi because I created a folder on my PC and it showed up in the CNC controller memory, and there are no hard wires from my PC to the machine. Still waiting on some feedback from IT. I'm tempted to set the I/O channel to the data server #5, but not sure how and not sure how that will effect the company network. I'm looking into it as we speak.

Thanks for the input - I'll keep updating the post.

  • Like 1

Share this post


Link to post
Share on other sites

Odd that Memory Card wants to go... sort of.

 

On some machines you can't transfer a program from USB to Dataserver, yet you can transfer from Memory Card.

Did you put a Memory Card in the slot before testing?

Dataserver typically uses FTP. Yours seems like an odd bird.

 

In Section 4.8 of the FANUC Parameter Manual, (covers parameters 901 through 930).

  • Like 1

Share this post


Link to post
Share on other sites

Yeah definitely an odd bird hah. Actually no I did not put the card in - I was told by a co-worker that it exists. Now that you mentioned I need to locate it.

Still unsuccessful with DPRINT but managed to get a hold of a technician - they're looking into it. Also reaching out to Fanuc - fingers crossed.

Also tried changing the IO4 bit to 1 on parameter 110, but no luck.

Regardless its been fun experimenting with macros - that's the most important part. Below is a clip of a fun macro program.

If you're experimenting with I/O settings, or any settings, you obviously don't want to wipe the existing ones. This program stores the current parameters - updates them - prints the new ones - and restores the originals. Obviously DPRINT needs to work. This is just a quick fun tip that you can build off of - nothing serious.

You mentioned you hope your original post opens up some possibilities. It absolutely did!

%
O0666 (DPRINT TEST)
;
(STORE CURRENT IO PARAMETERS)
;
#199 = PRM[20]
#198 = PRM[21]
#197 = PRM[22]
#196 = PRM[23]
;
(UPDATE PARAMETERS TO DESIRED IO CHANNEL)
;
G10 L52
N20 R17
N21 R17
N22 R17
N23 R17
G11
;
(PRINT UPDATED PARAMETERS)
;
POPEN
DPRINT[PARAMETER*OUTPUT*TEST]
DPRINT[]
DPRINT[-------------------------------------------------------]
DPRINT[PARAMETER*0020*=*#199]
DPRINT[PARAMETER*0021*=*#198]
DPRINT[PARAMETER*0022*=*#197]
DPRINT[PARAMETER*0023*=*#196]
DPRINT[]
PCLOS
;
M00
;
(CHECK FLASH DRIVE)
;
M00
;
(RESTORE ORIGINAL PARAMETERS)
;
G10 L52
N20 R#199
N21 R#198
N22 R#197
N23 R#196
G11
;
M00
;
(VERIFY PARAMETERS ARE RESTORED)
;
M30
%

 

  • Like 2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • 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