What's new
What's new

Fanuc POPEN and PCLOS, also DPRNT

Stephan Spears

Aluminum
Joined
Apr 12, 2014
Location
AB,Canada
Hello all,

Would anyone be able to help me out here? I am trying to use POPEN, DPRNT and PCLOS and record some machining information of my NC program to a txt/dat file, saved in a CF card. I am not sure how these commands behave when it comes to creating new files. Will the content be appended or will a new file be created after PCLOS?

Here's what I mean. What is the outcome of the following code?

Code:
%
O0001
N10 POPEN
N20 DPRNT[START*HERE]
N25 DPRNT[-------------]
N30 PCLOS

N40 G0 X0 Y0 Z0

N50 POPEN
N60 DPRNT[END*HERE]
N65 DPRNT[*************]
N70 PCLOS


Will the output be A text file, containing the following
Code:
START HERE
-------------
END HERE
*************

OR will the output be 2 different txt files, the first one contatins
Code:
START HERE
-------------

And the second one contains
Code:
END HERE
*************

Please help!

Thanks in advance.

Steph
 
Hello,

I had a chance to try out the program. It turns out everytime PCLOS is called, instead of appending new content to the previous file, my machine creates a new txt file in the CF card. Is there a parameter to control this behaviour?
 
My programs are designed to print something at the beginning of the program and then the machine will move and perform some tasks. At the end of the program, I would print out something else.

Let's say I only write PCLOS at the end of the program.

I will be able to print out something in the beginning, no problem. But if later, when the machine starts to move and some error occurs and I have to stop the machine with "RESET", the PCLOS at the end of the program will not be executed.
 
The file will be appended as long as the port remains open. Once you close it a new file will be created once the port is opened again. A parameter controls if you can create multiple files from popen. If your control is making a file named prnt_txt.dat out something similar you will have problems because according to parameters it cannot overwrite that file once you PCLOS. I don't recall the parameter sorry. So,. Don't PCLOS in your nc program. Before you take out the cf card you must PCLOS in mdi first or you won't have a file. And you have to remove the files from the card to start again. Fanucs implementation of this is a bit lacking.
 
Hello,

I had a chance to try out the program. It turns out everytime PCLOS is called, instead of appending new content to the previous file, my machine creates a new txt file in the CF card. Is there a parameter to control this behaviour?

I do not think so.
 








 
Back
Top