LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to control printer from labview

Hi,
 
  If any one have solution for my query please provide me.
 
I want to print word document line by line.
For eaxmple  i have 10lines to print;i start with 1st line it will goto to printer and then i want to hold on printer side
then 2nd line same process till 10th line.once finished 10 lines then release out from printer.
Indireclty holding printer.
 
How to do in Labview these kind of activity.
 
Thanks & Regards
Anitha
0 Kudos
Message 1 of 8
(7,307 Views)
There is no native LabVIEW functions that allow you to control a printer. In order to achieve what you want, you need to find out if the driver for the printer has an API you can use. An example of this would be a DLL that you can access VI the Call Library Funtion node and call the necessary functions.

Another way you could possibly do this is by connecting to MS Word through ActiveX and control the printing process this way.
Eli S.
National Instruments
Applications Engineer
0 Kudos
Message 2 of 8
(7,270 Views)

If your printer support Postscript, you can print text line by line.

I used to do this before LV5.1 (multi threads).

 

George Zou

http://www.geocities.com/gzou999/index.html

George Zou
0 Kudos
Message 3 of 8
(7,250 Views)
Hi George,

To my knowledge there is no way to control a printer natively from LabVIEW (7.0 - 8.5) unless using the Report Generation Toolkit. Otherwise you can use the Win32 API along with the Call Library Function node to control the printer. Please refer to the following two KnowledgeBase articles for further reference.


How Do I Print a File Programmatically From LabVIEW?

How Can I Programmatically Send a String to My Printer?

Eli S.
National Instruments
Applications Engineer
0 Kudos
Message 4 of 8
(7,202 Views)
Eli,
 
We are talking about print line by line.  Not relay control the printer.  Just the page layout.
Postscript is the tool for layout.  I know it can be done because I did it before.
 
George Zou
 
George Zou
0 Kudos
Message 5 of 8
(7,192 Views)
You mentioned in a previous post that you had done it in a previous version of LabVIEW. Can you tell me what version you did it in and what functions you used? I don't know of any functions to do that in LabVIEW 7.0 and up.
Eli S.
National Instruments
Applications Engineer
0 Kudos
Message 6 of 8
(7,173 Views)
It's the Postscript language makes the difference: page layout.  No matter how do you send it to the printer.  As long as the printer supports Postscript.
In your previous post, you mentioned a couple way to send string to printer.  You still can use those methods.
The string has to be wrapped in Postscript language.
 
George Zou
 
George Zou
0 Kudos
Message 7 of 8
(7,152 Views)
LabVIEW itself cannot do anything with PostScript natively. You can write some sort of DLL or wrapper that takes a LabVIEW string and passes it to PostScript.
Eli S.
National Instruments
Applications Engineer
0 Kudos
Message 8 of 8
(7,129 Views)