How to write and send a command to a Brother QL printer?

Now I'm trying to write a simple C # program that sends a command to the printer to print plain text, but does not know how to do this. There are two main problems that I now face

1, How to contact the printer?

After doing some search on Google, but did not get a satisfactory result, I went to the Brothers homepage and found the so-called b-PAC3 SDK

The b-PAC * software development kit is a software tool for Microsoft® Windows® that allows you to print custom shortcuts from your own applications.

After you downloaded and installed it, in the directory where it was installed, I found a folder called "Samples" - there are code samples written in another language (VB, VS, VSC, ...). I was hoping these code samples would work as this SDK and printer come from the same company. But they did not. Let me show you one of these samples here: (code in C #)

/************************************************************************* b-PAC 3.0 Component Sample (RfidRW) (C)Copyright Brother Industries, Ltd. 2009 *************************************************************************/ using System; using System.Collections.Generic; using System.Text; namespace ConsoleSampleCSharp { class Program { private const int NOERROR = 0; private const string ANTENNA_READER_WRITER = "Reader/Writer side"; static void Main(string[] args) { // Create Rfid Instance bpac.RfidClass rfid = new bpac.RfidClass(); // Rfid Instance string selectedDevice; // selected device /* GetInstalledDevices */ Console.WriteLine("==GetInstalledDevices()=="); object[] arrDevices = (object[])rfid.GetInstalledDevices(); if (rfid.ErrorCode == NOERROR) { Console.WriteLine("Succeed to GetInstalledDevices()"); int index = 0; foreach (string device in arrDevices) { Console.WriteLine(String.Format("[{0}] {1}", index, device)); index++; } // select device Console.WriteLine("Please Select Device"); int selectedDeviceIndex = int.Parse(Console.ReadLine()); selectedDevice = arrDevices[selectedDeviceIndex].ToString(); } else { Console.WriteLine("Failed to GetInstalledDevices()"); goto CleanUp; } // .... } } } 

When I run this code, the first problem arises: (it is displayed exactly the same as in the quote below, sorry, I can not post the image because of the low reputation)

== GetInstalledDevices () ==

Succeed in GetInstalledDevices ()

Select "Device"

There was no mistake, but it looks like the program cannot find my device, I do not know why this is happening.

2 How to write a QL style team?

I know that each type of printer has its own command language, so after searching on the Brother site I found a link:

Brother QL Series Command Reference (QL-500/550/560/570 / 580N / 650TD / 700/1050 / 1060N)

I myself have no experience with a thermal printer, and, unfortunately, there is no example in this command, which makes it very difficult for me to understand how a command should be written.

Has anyone worked with Brother QL serial printers?

ps: The printer I use is Brother QL 560

+7
source share
2 answers

To communicate with the printer, you need a few things:

  • Get a USB library such as libusb ( http://libusb.info/ )
  • Install a driver that will allow you to access the printer through libusb, for example, Zadig ( http://zadig.akeo.ie/ )
  • Download a link to the printer command from the Internet ("Brother QL Series Command Reference")

Using the information presented in chapter 7 of the help system and the samples supplied with libusb, create a small procedure that will detect and open the communication channel with the printer via USB.

Then, using the rest of the information available in the manual, send the ESC command to the screen to configure it or print labels.

PS: If you need to improve your background on a USB connection, I recommend a great link called "USB in a nutshell", available in outlogic dot org (I can’t post more than two links).

+1
source

I think OPOS (from Microsoft) should be one of the solutions for your business provided by Brother QL 560 offering its own opos driver. Once you get the driver (in dll), you can just start development as easily as with using common web controls.

0
source

All Articles