LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to not lock up LabVIEW exe by printing?

I've seen various forms of this question; but they are all from 2002 or earlier. I am using LV 6.1 on Windows 2000 (and XP). My test station is set up using Windows 2000, so that is what I am currently troubleshooting.
 
I have a program that needs to run continuously updating a waveform graph on the screen; meanwhile, after recieving a digital signal, I need to do some statistical calculations and print out two pages of a report. The problem is that once I start running the routine starts printing out the reports (they are just VIs that print the front panel when complete) my waveform graph, and the rest of the GUI stops executing for about a minute and a half.
 
The printer I am printing to is connected via windows networking (it is a shared printer from a server, also running Windows 2000). I've looked at the different printing options (standard, postscript, and bitmap) but none of them really help any in terms of freeing up the cpu for my program to continue updating its front panel. The most 'freeze-time' I can accomodate in the program is 10 seconds; as the user may need to make additional time-critical (or, at least things that can't wait a minute and a half) requests on the system at that time.
 
Are there any ideas as to how I can improve the speed of this process? I know that it lies within the printing, because if I 'comment out' the printing portion only; things run just fine. I've tried building a separate executable in LV that just handles the printing, but this still does not solve my problem.
 
 
0 Kudos
Message 1 of 22
(3,959 Views)
Latest printer driver installed?
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 2 of 22
(3,951 Views)
How is the threading ( preferred execution system)?
Try user interface and standard-- who knows - just a suggestionSmiley Tongue
Have you disabled debugging ?

Read application note 199: Labview and Hyper -Threading

chow
xseadog
0 Kudos
Message 3 of 22
(3,945 Views)

The printer drivers are up to date, I am not operating on a computer that has a hyper-threading CPU. (The computer is several years old.)

Some additional information:

The program performed OK on a faster system, windows XP, and printing to a printer on the network (one with a network jack in it, as opposed to being shared via windows).

I just cannot give up on this slower PC, as my boss insists that the program should work there as well; in addition, I need to know if this is a Windows 2000 vs XP type issue, or if it is related to the printer being shared vs networked. Or if the PC is just too slow to handle running my program and printing at the same time.

We sell products both using the Windows 2000 and Windows XP platforms, so if this particular product will only work acceptably under XP, I will need to know that.

0 Kudos
Message 4 of 22
(3,941 Views)
I had this problem before LabVIEW 5.1, before LabVIEW became multithread.
My solution was: embed postscript code in LabVIEW, bypass Windows print spooller, send postscript code directly to a local postscript printer on LPT1.
The reason it works is because that instead of sending a big image I sent postscript code which can be splitted to a few lines at a time.  That minimize the  lockup time to < 9 ms.
 
With LabVIEW 6.1, you shouldn't have this problem.  You might want check the multithread settings.  See attached image.
 
George Zou
George Zou
0 Kudos
Message 5 of 22
(3,940 Views)
The multi-threading is turned on.
0 Kudos
Message 6 of 22
(3,924 Views)
Is spooling enabled in Control Panel/Printers?
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 7 of 22
(3,912 Views)

Yes, spooling is enabled; it is set to start printing immediately once the first page is spooled.

I'm beginning to think that the issue may be that I am printing to a windows shared printer, and the delay is the spooling taking place over the network? I have not studied how windows handles shared printers, but it seems like what may be happening is that my test PC is sending the data to the spooler on the remote server that is connected to the printer. This server is far from beefy (in fact, it may even be slower than my test machine is in terms of processor speed), it is also running Windows 2000.

0 Kudos
Message 8 of 22
(3,907 Views)
Alternatively, is there a way that I can pawn off the printing process to another program entirely by having LabVIEW print to a picture instead of a printer? I know when I use "File->Print..." I can have it print to an html file, which yields a png of the printout; it does not seem possible to do this programatically though?
0 Kudos
Message 9 of 22
(3,899 Views)

There is a PrintControlExample.vi in Help (LV7.1) that uses report generation vi's to print to a printer or to a HTML file. Do not know about 6.1 availability.

Have you also looked at Task Manager Processes and also the Networking tab to look for what may be using up the resources- the LV program, the spooler, or the network connection. Is network connection running at full speed, full duplex?

Have you also tried a printer directly connected to the parallel port (skip all networking) to see what happens.

I do not have all that much experience in these isssues, I am just trying to throw out fresh ideas.

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 10 of 22
(3,890 Views)