08-11-2014 02:54 PM
I designing a subVI to generate a failure report which when it is arrived to in the larger program, it will compile some information like time, date, the user's employee ID, the part number being tested and a few other peices of information collected from outside the VI. I would like the VI to print to the default printer on the computer it will be installed on (which is a Epson TM-T20 Thermal printer). I have looked at as many examples of the usage of the Report Generation toolkit on the NI forums as I could find (which seem to be few and far between) and havn't found out what I could be doing wrong. The VI in question is attached.
08-11-2014 03:18 PM
What problems are you experiencing?
Mike...
08-11-2014 03:57 PM
Ok, let me guess, you are seeing an error that says an invalid printer was selected, right? Well there is a bug in your code but it has nothing to do with the printer that you have selected. Specifically you have some of the margin values set to zero -- which is invalid. The margins have to have a value of at least 1. In case you're interested, I followed down the logic and inside the print report VI the code, for some unknown reason (NI is checking into it), remapps an error code that correctly identifies invalid margins to report one that reports an invalid printer name. Apparently this was first reported in 2008.
Verified this behavior of both LV2013 and 2014.
Mike...
08-12-2014 08:25 AM
Yes, I was having that error but now that I have changed my margins to 1 on all sides I don't have any errors but it is still not printing. Does this have anything to do with the error code from before or does this have to do with the report VIs being set up incorrectly on my side?
By the way, thank you very much for your help so far!
08-12-2014 09:46 AM
This could have nothing to do w your problem but it sounds similar to my Seiko thermal printer problem. I got the same error saying it wasn't a valid printer and it turned out to be the margins. Mine was trial and error. 1st make sure the print driver is loaded..Then go into Windows (devices and printers) left click on your printer ( epson..also make sure its the default) right click on printer preferences then advance ( lower right). See if you have a paper size of 58mmx293 mm and select that. In your vi for printing make sure your margins are..for starters..top=1, bottom=1, left and right = .75. If I changed any one of these by one digit they didn't work. I also missed the paper size in the devices and printer selection for windows 7.
08-12-2014 10:03 AM
Thanks for your response Clint_Eastwood! I have done the changes you reccomended. The printer was already set as default (therefore the driver should be installed right?) and I made sure that the paper size is set correctly for the 80 mm x 273 ft roll that it prints on. Would having the margins too small cause the printer to not even start operating? When I run the program after taking out the delay near the end, it takes only about a second to run and doesn't appear to do anything at all.
Thanks again for your help!
08-12-2014 10:04 AM
Your original code worked fine on my HP laser printer with the 0's just set to 1.
Mike...
08-12-2014 10:13 AM
Like I said..it was trial and error for the margins for me. If I chg'd one digit it didn't work. Sorry but I don't now what to tell you other than to play w the parameters.
08-12-2014 10:25 AM
What status is showing in the print monitor window?
Mike...
08-12-2014 10:42 AM
mikeporter: What print moniter window? If you are talking about the window that would pop up to configure a print in programs like Microsoft Word, I havn't been getting that to pop up at all.
Clint_Eastwood: Do you have any method to go about your trial and error or just completely random trial and error?