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. C#
  4. Print to POS Printer on serial port

Print to POS Printer on serial port

Scheduled Pinned Locked Moved C#
questionhelp
5 Posts 3 Posters 0 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.
  • T Offline
    T Offline
    Tavbi
    wrote on last edited by
    #1

    Hi, I have an application where I print bills to POS printer connected to serial port COM1. How can I check if printer in turned on and printer status is ok. When I do serialPort.Write(myString) I do not get any error. How can I check printer or serial port status? Thank, Jure

    O M 2 Replies Last reply
    0
    • T Tavbi

      Hi, I have an application where I print bills to POS printer connected to serial port COM1. How can I check if printer in turned on and printer status is ok. When I do serialPort.Write(myString) I do not get any error. How can I check printer or serial port status? Thank, Jure

      O Offline
      O Offline
      originSH
      wrote on last edited by
      #2

      Most POS printers have a driver/api so that you can do these things more easily. THe most common printers (in the UK anyway) are the epson TM80's which can use the epson unified stuff: http://www.pos.epson-europe.com/support/drivers.htm[^] If yours is a different manufacturer I'd suggesting checking with them.

      T 1 Reply Last reply
      0
      • T Tavbi

        Hi, I have an application where I print bills to POS printer connected to serial port COM1. How can I check if printer in turned on and printer status is ok. When I do serialPort.Write(myString) I do not get any error. How can I check printer or serial port status? Thank, Jure

        M Offline
        M Offline
        martin_hughes
        wrote on last edited by
        #3

        In addition to what originSH said, a lot of serial type devices also support a control set, where by you send off some command sequence to the device and expect a response. If you don't get a response (or it times out or whatever), then you know something's up.

        "It was the day before today.... I remember it like it was yesterday." -Moleman

        T 1 Reply Last reply
        0
        • O originSH

          Most POS printers have a driver/api so that you can do these things more easily. THe most common printers (in the UK anyway) are the epson TM80's which can use the epson unified stuff: http://www.pos.epson-europe.com/support/drivers.htm[^] If yours is a different manufacturer I'd suggesting checking with them.

          T Offline
          T Offline
          Tavbi
          wrote on last edited by
          #4

          Hi, I am not using any drivers for my printer because I don't use graphical printing. I send text directly to serial port. SerialPort serialPort=new SerialPort("COM1",9600,Parity.None,8,StopBits.One); serialPort.Open(); serialPort.Encoding = Encoding.GetEncoding(852); serialPort.Write(stringToPrint); serialPort.Close(); So I must urgently install driver if I completely understand you.

          1 Reply Last reply
          0
          • M martin_hughes

            In addition to what originSH said, a lot of serial type devices also support a control set, where by you send off some command sequence to the device and expect a response. If you don't get a response (or it times out or whatever), then you know something's up.

            "It was the day before today.... I remember it like it was yesterday." -Moleman

            T Offline
            T Offline
            Tavbi
            wrote on last edited by
            #5

            Can you tell me what can I do in my code? SerialPort serialPort=new SerialPort("COM1",9600,Parity.None,8,StopBits.One); serialPort.Open(); serialPort.Encoding = Encoding.GetEncoding(852); serialPort.Write(stringToPrint); serialPort.Close(); Thank, Jure

            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