09-21-2020 11:29 AM
I am looking for a print directly from LV to a Zebra label printer. Requirements:
What would you suggest?
I've been trying this:
left side: how to get rid of the vi title at the bottom?
right side: poor quality and the size of the font (configured with 24) does not affect.... any ideas especially about the quality? anti aliasing would be good.
or are there ways recommended? any help appreciated.
thanks in advance
Solved! Go to Solution.
09-21-2020 02:19 PM - edited 09-21-2020 02:20 PM
Don't try to print directly to the label printer from the report toolkit. Use the Zebra software to design a label. From there you can output EPL or ZPL code to a text file. This is the code that you can send to the printer that will print your label. Take this code file and add tokens for the variable information. Save this code in your project. When you need to print a label, replace the tokens and save the label code as a temporary file.
You will need to have your Zebra printer shared and give it a name.
Using the System EXEC VI, you can copy the temporary file to the printer using the printer share name.
cmd /c copy %filename% \\%computername%\%printershare%
09-23-2020 01:19 AM
Wow, that's awesome!
Thank you @aputman for all these insights. You hit me to the right direction, saving me a lot of time and effort.
Now I know also what to look for here in the forum: ZPL is the key
05-17-2021 11:36 AM
Hello,
I'm currently looking to do something similar to what you are saying, but am having trouble interfacing the printer and LabVIEW. Would you be able to share the code you used to have LabVIEW trigger the print on the Zebra?
Thanks very much.
05-18-2021 07:00 AM
What model printer are you using? What is your interface to the printer? I generally send the ZPL directly to the printer bypassing all drivers. If you have a network interface (wired or wireless) simply use TCP to connect to port 9100 and send the ZPL. If you are using USB I can see if I can release our LabVIEW library which uses the Zebra SDK to communicate with the printer. Serial and parallel ports can also be accessed directly from within LabVIEW using VISA.
05-18-2021 09:02 AM
If you are using USB, you only need to use the command I wrote above. After giving the printer a share name, you can copy a label ZPL or EPL code file directly to the printer and it will print.
cmd /c copy %filename% \\%computername%\%printershare%
05-18-2021 02:43 PM
I am using a GC420t printer interfacing with USB. I have so far been unsuccessful in interfacing the printer with NI MAX or VISA.
05-18-2021 02:49 PM
I do intend to use USB. I understand the method of copying a ZPL code file, but I am not sure how to give the printer a share name. Are you able to expand on how to do that? Thank you.
05-18-2021 02:51 PM - edited 05-18-2021 02:54 PM
That is the same printer I use. You do not need VISA or Max. You only need a command prompt using the command I have posted twice now.
Edit: Go to Printer Properties -> Sharing and enter a name. Do not use a name with spaces. This may look different on Win10 computers. This screen is from Win7.
05-18-2021 02:55 PM - edited 05-18-2021 02:55 PM
@kjr53105 wrote:
I am using a GC420t printer interfacing with USB. I have so far been unsuccessful in interfacing the printer with NI MAX or VISA.
You can't connect to the printer via USB using VISA or NI Max, at least not easily. It was possible prior to Windows 7 but Windows 10 requires driver files to be signed which makes it very difficult. You could use the approach that Putnam suggested or I can see if I can package up our code which uses the Zebra SDK.