NI Home > Community > NI Discussion Forums

LabVIEW

Reply
Member
HaemoPhil
Posts: 11
0 Kudos

Labview driven USB Label printer

Dear Labview user,

I'm looking to implement a USB Label printer into my Labview application, this printer should print out some parameters that where used in the running application.
Does someone of you know if there exemple exist for such USB communication system or did some one already experienced USB communication with Labview and a third part device like a printer.

Thanks in advance

Regards

HaemoPhil
Trusted Enthusiast
rolfk
Posts: 4,543

Re: Labview driven USB Label printer



HaemoPhil wrote:
Dear Labview user,

I'm looking to implement a USB Label printer into my Labview application, this printer should print out some parameters that where used in the running application.
Does someone of you know if there exemple exist for such USB communication system or did some one already experienced USB communication with Labview and a third part device like a printer.


Unfortunately USB is not just another communication interface with an according API to program like you are used with serial or GPIB. USB is just the lowest level of the electrical specification and protocol for an interface and the actual data transfer is then managed in a differnt protocol level that is highly device specific.

VISA does allow to communicate with USB devices on raw level which means you have to implement the higher level protocol yourself. But without the exact protocol specification used by the device you can't do that and many devices especially in the consumer area do not really specify the exact protocol they use or use one of the predefined protocol classes all modern OS do already have some protocol support for.

As such it is difficult to give a generic advice that would fit all USB devices. Printers I would expect to be handled by the Windows printer manager and should be accessed through the standard Windows printer interface. Label Printers are somewhat special as they do not fit well into the page oritented printing system Windows and most other OS's are using so they usually have their own application that controls them. This application accesses the label printer usually over a proprietary protocol interface. While the protocol itself is almost never disclosed the interface API sometimes is and that can be either a DLL interface or an Active X Automation Server interface (and newer versions probably .Net).

Depending on what interface is provided AND documented you will either have to use the Call Library Node to access the interface API DLL or the Active X (or .Net) functions to get the according interface running. Trying to talk to the device on USB raw is no option IMHO eventhough the protocol may be documented  (which is highly unlikely).

Rolf Kalbermatter
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions
LabVIEW ArchitectLabVIEW ChampionLabVIEW Instructor
Active Participant
Brian_Beal
Posts: 932

Re: Labview driven USB Label printer

I have used the Brother PT-9500DX with Labview and USB.  Brother has an SDK, called B-PAK, that uses com objects to control the printer.
Member
HaemoPhil
Posts: 11
0 Kudos

Re: Labview driven USB Label printer

Brian,

Thanks for information, the Brother SDK looks much more complete as the one we where looking for from Seiko...

Would it be possible for you to send me an example of your Labview implementation as I am really new and not familiar in such programing methodes...

Thanks in advance...

Active Participant
Brian_Beal
Posts: 932

Re: Labview driven USB Label printer

Here is an example.  You need to create a label template using the regular Brother software.  You can then run your Labview program to change the data in the template, and print your label.
Member
HaemoPhil
Posts: 11
0 Kudos

Re: Labview driven USB Label printer

Brian,

Thanks a lot that's exactly what I need for my application... 

Regards 

Trusted Enthusiast
Trusted Enthusiast
JB
Posts: 2,729
0 Kudos

Re: Labview driven USB Label printer

We use different label printers from Citizen. We have developped a driver for the serial port and for USB.
Member zeb
Member
zeb
Posts: 2
0 Kudos

Re: Labview driven USB Label printer

Awesome Brian, that code worked perfectly. How did you know to use that DLL? I found it at C:\Program Files\Brother bPAC SDK\Samples\VBNET\bin\Interop.BrssCom.dll. Also, how did you redistribute this, just printer drivers and this DLL or did you somehow use their redist files?

Thanks again,
zeb
Active Participant
Brian_Beal
Posts: 932
0 Kudos

Re: Labview driven USB Label printer

The details are a little foggy, but I think I just followed the instructions that came with the SDK download.  They were geared towards VB, but the made sense for Labview.  I don't know if I ever had to redistribute these.  You will probably need to install both the driver and SDK on a target machine.
Member
ssilk
Posts: 28
0 Kudos

Re: Labview driven USB Label printer

I use Zebra TLP-3844-Z's (usb interface) with great results, I just load them on as the windows default printer then use the easy text report vi to pump the text data to my default windows printer.  I have about 15 of these running in a production environment printing anywhere from 60 labels per hour to 300 labels per hour.  The only fallback is the fact that you rely on windows to get your label there in a timely manner which depending on your program load on the cpu could cause some lag in the print.