Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Printing to Zebra label printer

Hi there,

I have to print serial numbers with a Zebra Z4M+ label printer. I design Labels with Bar-One

Lite and save them as *.txt files. On each label I have placed a text box with dummy text. Then

I open the text file with notepad and replace this dummy with "%s". This variable I then replace

within my LabVIEW application with the actual serial numbers. So far so good...

I tried several methods to print this string to LPT1. If I print it with "copy myfile.txt LPT1"

via command.com, it works fine. If I try the same operation (identical command line, correct

working directory) with the LabVIEW System Exec.vi, nothing happens. An error is reported (2:

Memory is full)

Printing with VISA write from file.vi causes LabVIEW to crash (cpp error line xxx). After

quitting the error dialog, LV closes and the print starts, but not the complete label is

printed.

When printing with VISA write.vi (Resource name LPT1 or ASRL10::INSTR), no error is reported but

also nothing else happens.

I then tried to print with the old serial port write.vi (serial.llb). When I want to print the

whole label (text file with approx. 600 KB), a error is reported: -1073807339 (VISA: (Hex

0xBFFF0015) Timeout expired before operation completed.). When I send a smaller string (only the

part with the serial number, without all the graphics information), these numbers are printed

correctly.

I tried it also via COM1, and that works perfectly. Unfortunately I have no spare COM port,

because the only one available on my machine is already used to connect some FieldPoint modules

to my application.

Can anybody help me out? How do I have to use the VISA VIs to write to LPT? Any other

suggestions? I guess the solution isn't that complicated because printing directly from Bar-One

Lite to LPT1 and from command.com works fine...I would really appreciate any help I can get!

Before I forget it: I use LV7 on a WinXP machine

Thanks in advance
Kind regards

Achim Traeger
0 Kudos
Message 1 of 7
(7,398 Views)
Hi,

for an easy way to communicate with a printer use the report VI´s. These VI´s are using the printer manager of OS.

Example: see below

Roessner
NI Germany
0 Kudos
Message 2 of 7
(7,397 Views)
Hello Achim,

error -1073807339: see link
http://www.ni.com/support/labview/visa/verr2.htm

http://digital.ni.com/public.nsf/websearch/77F74B37A40ABC5F8525645A000300AF?OpenDocument

You can also update your VISA driver.

http://digital.ni.com/softlib.nsf/websearch/8E7D54CA3A1FDECF86256E4D007ED2E0?opendocument&node=132060_US

Regards
TN
0 Kudos
Message 3 of 7
(7,397 Views)
Hey guys, thanks for your answers!

To ThorstenRo: Your example works even with the Zebra printer. Unfortunately the function "append file to report" needs about a minute to import the file (ca. 700 KB) to the report. After that the printout works fine. Another disadvantage is that I have to read my original file, replace the variables, and write it again to HD so that I then can append it to the report. (Well, my workaround works in a similar fashion, although that's not very smart)

If I read the file with "read characters from file" and append this text then directly to the report, the undefined error -2147352567 occurs. (See attachment)

To TN: I haven't yet tried to use the VISA function again, although the provided links may contain some use
ful hints.

I tried again with the System Exec function and eventually it worked: The command line has to be: "cmd /C copy D:\MyFile.txt LPT1" (at least on WinXP) So before the print the original file "MyOriginal.txt" has to be read, the variables to be replaced and this altered file to be saved as "MyFile.txt.

...and don't ask me why it did not work at the beginning...I have no idea 😉

Thanks again
Regards

Achim
0 Kudos
Message 4 of 7
(7,397 Views)
Hello Achim,

I am quite eager to try out your print_txt-data_V2.vi but it is in LV 7.1. But i am using LV 7.0. If possible could you send me the same which can be viewed using LV 7.0.

I am also working on similar application but the printer i am using is FARGO PRODIGY LABEL PRINTER. I am not sure how to program this printer using Labview as i have seen any useful information regarding this printer.

Appreciate your inputs on this regard.

Thanks
Bharat
0 Kudos
Message 5 of 7
(7,289 Views)
Hello,

I tried to save it for previous to 7.0 for you, but there are subVI's which were not included; the owner should be able to save it for previous for you 🙂

Best Regards,

JLS
Best,
JLS
Sixclear
0 Kudos
Message 6 of 7
(7,273 Views)

HI,

 

I want to print labels with barcode using seagull bartender and labview and I have to transfer the barcode from labview to the label and print it automatically with labview.

 

Best regards

 

Belrhadi yassin

Test and validation engineer-Premo Group

0 Kudos
Message 7 of 7
(5,597 Views)