Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Hardware & Devices
  4. CBM-1000 II printer and communication with C# 2.0

CBM-1000 II printer and communication with C# 2.0

Scheduled Pinned Locked Moved Hardware & Devices
csharphelptutorialquestion
3 Posts 2 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 760516
    wrote on last edited by
    #1

    Hi all. I cant understand what`s wrong in my code... I`ve got "Command Reference" of Citizen CBM-1000 II Line thermal printer. For example, cutting the paper:

    [Command] (1) GS V m .......
    [Command] (2) GS V m n .....
    [Function] Cutting the paper
    [Code] (1) <1D>H<56>H
    (2) <1D>H<56>H
    [Range] (1) m = 1, m = 49
    (2) m = 66
    0 <= n <= 255
    [Outline] Performs the specified paper cutting.
    Value of 'm' ---- Function
    1 or 49 ---- Partial cut (Leaving a bridge area uncut)
    66 ---- Paper feed by “cut position + {n ´ basic calculation
    pitch}”and partial cut (Leaving a bridge area uncut)

    Here`s my code (C# 2.0): SerialPort printer = new SerialPort("COM4"); printer.Open(); byte[] buffer = new byte[3] { 0x1D, 0x56, (byte)1 }; printer.Write(buffer, 0, 3); // printer.Write("GS V 1"); printer.Close(); Printer do not cut the paper. Just printing some symbols... What`s wrong here ? Please help.

    S 1 Reply Last reply
    0
    • U User 760516

      Hi all. I cant understand what`s wrong in my code... I`ve got "Command Reference" of Citizen CBM-1000 II Line thermal printer. For example, cutting the paper:

      [Command] (1) GS V m .......
      [Command] (2) GS V m n .....
      [Function] Cutting the paper
      [Code] (1) <1D>H<56>H
      (2) <1D>H<56>H
      [Range] (1) m = 1, m = 49
      (2) m = 66
      0 <= n <= 255
      [Outline] Performs the specified paper cutting.
      Value of 'm' ---- Function
      1 or 49 ---- Partial cut (Leaving a bridge area uncut)
      66 ---- Paper feed by “cut position + {n ´ basic calculation
      pitch}”and partial cut (Leaving a bridge area uncut)

      Here`s my code (C# 2.0): SerialPort printer = new SerialPort("COM4"); printer.Open(); byte[] buffer = new byte[3] { 0x1D, 0x56, (byte)1 }; printer.Write(buffer, 0, 3); // printer.Write("GS V 1"); printer.Close(); Printer do not cut the paper. Just printing some symbols... What`s wrong here ? Please help.

      S Offline
      S Offline
      Sebastian Schneider
      wrote on last edited by
      #2

      You probably have to set the printer to a special mode that interprets the data instead of printing it. This could either be done by setting a pin, sending a special sequence or changing a setting on the printer manually.

      U 1 Reply Last reply
      0
      • S Sebastian Schneider

        You probably have to set the printer to a special mode that interprets the data instead of printing it. This could either be done by setting a pin, sending a special sequence or changing a setting on the printer manually.

        U Offline
        U Offline
        User 760516
        wrote on last edited by
        #3

        I did it ! :) ;P :laugh: But from code: SerialPort p = new SerialPort("COM1", 19200, Parity.None, 8, StopBits.One); p.Open(); Stream s = p.BaseStream; byte[] buff = new byte[7] { 0x1D, 0x28, 0x41, (byte)2, (byte)0, (byte)2, (byte)2 }; s.Write(buff, 0, 7); s.WriteByte(0x1d); s.WriteByte(0x28); s.WriteByte(0x31); s.Close(); p.Close(); This basic code will print test page and then cut the paper.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups