From 11:00 PM CDT Friday, May 10 – 02:30 PM CDT Saturday, May 11 (04:00 AM UTC – 07:30 PM UTC), ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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,523 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,503 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,496 Views)
Here is one way to do it.  Uses the default printer on your machine.
 
 
Message 4 of 35
(11,480 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,473 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,463 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,445 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,441 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,434 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,417 Views)