LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I send text file to printer port?

Again,

take the text in your batch file and place it between the "" in the following line and send it to the system exec as a string

cmd /C ""

Shane

Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 21 of 35
(2,608 Views)
My text file includes printer commands. Do u think that problem related with them. Batch file converts my printer commands in the textfile  to graphic. I want to sent these printer command my printer port to see again graphic. When I use batch file, I used to copy command like copy c:\plot.txt lpt2    This shows graphic. Then I try without batch. I wrote cmd/c "copy c:\plot.txt >lpt2".    I said again that  saw only 1file(s) copied.
0 Kudos
Message 22 of 35
(2,602 Views)
Maybe it's a language difference problem, but I'll repeat for the third time....

Use the SAME text in your system exec command string as in your batch file, but place it inside the "" int he following line

Cmd /C ""

Thus, if you say copy c:\plot.txt lpt2 works then please try Cmd /C "copy c:\plot.txt lpt2"

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 23 of 35
(2,598 Views)
Can you please post the part of your vi that does this print?  And a copy of the text file?
0 Kudos
Message 24 of 35
(2,597 Views)
sys.exec.vi
0 Kudos
Message 25 of 35
(2,588 Views)
0 Kudos
Message 26 of 35
(2,588 Views)
Please post a copy of your .bat file.  Thanks.
0 Kudos
Message 27 of 35
(2,577 Views)

filozof,

I got it figured out and was able to get your file to print on my printer here. 

First your "text file" is NOT a text file.  Your file is the output of a "print/plot to file" operation.  It must be copied to the printer port.

I've attached an LV 8.2 copy of my vi.  Maybe some kind soul monitoring this can convert it to LV 7.1 for you.  I'll also include an image of the block diagram.  Please note that I have used the "Working Directory" input.  This will not work if you try to include the path in the copy command. 

Download All
Message 28 of 35
(2,569 Views)
Yeah It works thank you so much.
0 Kudos
Message 29 of 35
(2,550 Views)

Thanks again for hole advise.

Do you know how can I do same job without windows command?

0 Kudos
Message 30 of 35
(2,543 Views)