LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I send text file to printer port?

I need to print a txt file from printer. I use sys exec.vi and bat file to do this. Bat file contains copy C:\plot.txt to lpt2  command. How can I do same issue with labview icons?
0 Kudos
Message 1 of 35
(11,488 Views)
Look at the functions on the "Report Generation" palette.   There are also several examples that ship with LabView.
0 Kudos
Message 2 of 35
(11,468 Views)
Thanks for reply message. I tried lots of vi to sending but They are not send txt file to printer port.
0 Kudos
Message 3 of 35
(11,461 Views)
Here is one way to do it.  Uses the default printer on your machine.
 
 
Message 4 of 35
(11,445 Views)
I have labview v7.1. It is for 8.2.  I can not open by 7.1 because of error code 9.
0 Kudos
Message 5 of 35
(11,438 Views)

Hi filozof,

Try:

cmd /C "C:\plot.txt to lpt2"

on the sysexec command line.

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 6 of 35
(11,428 Views)

Sorry, I don't have 7.1 loaded.  Maybe someone else can convert it?    tbd's solution will work.  My solution uses the Report Generation vi's and allows you to control the font settings.  The "Print Report.vi" also has inputs for printer names and # of copies.

 

Message 7 of 35
(11,410 Views)
I think tbd's answer is pretty much the answer to your question.

Funny though, I always use the notation Cmd /C "C:\plot text.txt >lpt1"

I wasn't aware of the "to" syntax.

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
Message 8 of 35
(11,406 Views)

 


@shoneill wrote:
I think tbd's answer is pretty much the answer to your question.

Funny though, I always use the notation Cmd /C "C:\plot text.txt >lpt1"

I wasn't aware of the "to" syntax.

Shane.


Smiley Very Happy - good eyes, Shane!

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
Message 9 of 35
(11,399 Views)
thanks friends.. I can print with batch file. Batch file contains copy C:\plot.txt lp2:. It works but I need to do samething with labview icons. When I used to report generation icon, It prints front panel like image. I want to send txt file to printer port(lpt2).
0 Kudos
Message 10 of 35
(11,382 Views)