Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Bluetooth

How to Setup Signal to Sato Printer?

0.00/5 (No votes)
3 Feb 2016CPOL3 min read 12K   212  
Signal which Sato Printer can read

Introduction

In this tip, I will show you a signal which Sato printer can read and how to create that signal. Sato is a big brand of industrial barcode printer. It stands at the second place in the barcode printer market. So if you have a Sato printer in your company, you can develop a program which can print barcode following your demand.

Etc: Your company buys a program which is using Sato printer to print barcode. After 2 years, that program hasn't been supported, your company doesn't want to buy a new program. You're in IT in your company, you have a mission developing a new program which has features that are the same with the last program. However, you don't how to print barcode with that printer, so this tip will help you.

Background

To send signal to Sato printer, you must know how to connect a printer through USB cab, bluetooth, Lan, Wifi or IrDA port by a program language. Connecting with Sato printer is the same with connecting all peripherals, that is very simple. You can search to find it easy.

Etc: For bluetooth connecting, you can search about InTheHand DLL, https://32feet.codeplex.com/.

C# code connects by bluetooth:

C#
BC = new BluetoothClient();
//Declare main BLT address
BluetoothEndPoint EP = new BluetoothEndPoint(BluetoothAddress.Parse("" + ComputerBLTADD + ""), 
	BluetoothService.BluetoothBase);
//Decalre client BLT address
BC = new BluetoothClient(EP);
BluetoothDeviceInfo BTDevice = new BluetoothDeviceInfo(BluetoothAddress.Parse
	(StandardBLTADD(txtBltAddress.Text)));
MacBluetooth = txtBltAddress.Text;
//Connect printer with a pin code 0000000000000000
if (BluetoothSecurity.PairRequest(BTDevice.DeviceAddress, "0000000000000000"))
{
    if (BTDevice.Authenticated)
    {
        //MessageBox.Show("Authenticated OK");
        //BC.SetPin("cfcfcfcf");
        BC.SetPin("0000000000000000");
        BC.BeginConnect(BTDevice.DeviceAddress, BluetoothService.SerialPort, 
		new AsyncCallback(Connect), BTDevice);
        MessageBox.Show("Connected successfull. Ready to print", "OK", 
		MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
}

Note: With bluetooth connect, each device will have a different pin code. With Sato Printer, you can contact production or retail to take it. 

Next step, after connecting with printer, you must send signal to printer. The printer can know how to declare and design it.

Using the Code

Now, we will reseach together about signal which can be read by Sato Printer.

C#
string data = ESC + "A" + ESC + "V0010" + ESC + "H0010" + ESC + "FW0000V0500H0420";
data = data + ESC + "PS" + ESC + "H0010" + ESC + "V0075" + ESC + "L0202" + 
		ESC + "P05" + ESC + "XU- Bluetooth Test -";
data = data + ESC + "PS" + ESC + "H0015" + ESC + "V0170" + ESC + "L0202" + 
		ESC + "P05" + ESC + "XUBD add " + MacBluetooth + "";
data = data + ESC + "V0250" + ESC + "H0080" + ESC + "P10" + ESC + "L0102" + 
		ESC + "B101045*" + MacBluetooth + "*";
data = data + ESC + "V0350" + ESC + "H0260" + ESC + "BQ3004,2" + MacBluetooth + "";
data = data + ESC + "PS" + ESC + "H0005" + ESC + "V0360" + ESC + "L0202" + 
		ESC + "P05" + ESC + "XU[lapin series]";
data = data + ESC + "PS" + ESC + "H0030" + ESC + "V0480" + ESC + "L0202" + 
		ESC + "P05" + ESC + "XUSATO CORPORATION";
data = data + ESC + "Q0001" + ESC + "Z";

Now we will analyze this example:

  • "data" in this example is a string which will be sent to printer through a socket or other method (demand method connect).
  • ESC is a character which Sato printer will know as a break character to delimite command.

C#:

String ESC = "\x1B";

VB:

ESC As String
ESC = Chr$(&H1B)
  • "A" is declared as character start design, "Z" is declared as character end design.
  • "FW0000V0500H0420" is command declare paper size. 
  • "H0010" , "V0075" is the position start printing in label.
  • "XU- Bluetooth Test -": print character - Bluetooth Test - in XU font. XU font is a special font which is defined by Sato group.
  • B101045*" + MacBluetooth + "*" : Print Barcode have value equal MacBluetooth.
  • "BQ3004,2" + MacBluetooth + "": Print QR barcode have value equal MacBluetooth.

Note: With each printer model, we will receive different font, barcode font, QR barcode font. So to print, you need to reseach about how to declare font for Sato printer in the attached file. Try a few fonts, you can receive correct font which your printer can read. 

Points of Interest

When you can connect Sato printer in PC, you will know how to PC communicate with peripherals as normal printer. And you can totally reseach about them and program your sofware to use them in an easier manner.

You can follow the above steps with most printers when you do with them: Connect, design signal, send to printer. 

END

Hope I can support you if you are working with a printer barcode.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)