473,626 Members | 3,247 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

POS Printer Problem

2 New Member
Hi All,

I'm a newbie to the POS system. so please mind if my questions are stupid.

I have an epson TM-U200 printer with USB connection and cash drawer connected to printer with RJ 11 cable.

I tried to create a service object for my printer and suceeds.(It shows on test app as a POS Printer)

this is my code for that.
Expand|Select|Wrap|Line Numbers
  1. [HardwareId(@"USB\Vid_0525&Pid_a700",@"USB\Vid_0525&Pid_a700")]
  2.     [ServiceObject(DeviceType.PosPrinter,"PrinterTemplate","Printer Class",1,9)]
  3.     public class MyPrinter : PosPrinterBase
  4.     {   private string MyHealthText;
  5.  
  6.         public MyPrinter()
  7.         {        
  8.             // Initialize device capability properties.          
  9.             MyHealthText = "";
  10.         }
  11.  
  12.         ~MyPrinter()
  13.         {
  14.             Dispose(false);
  15.         }
  16.  
  17.         // Release any resources managed by this object.
  18.         protected override void Dispose(bool disposing)
  19.         {
  20.             try
  21.             {
  22.                 // Your code here.
  23.             }
  24.             finally
  25.             {
  26.                 // Must call base class Dispose.
  27.                 base.Dispose(disposing);
  28.             }
  29.         }         
  30.         #region PosCommon overrides
  31.         // Returns the result of the last call to CheckHealth().
  32.         public override string CheckHealthText
  33.         {
  34.             get
  35.             {
  36.                 // MsrBasic.VerifyState(mustBeClaimed,
  37.                 // mustBeEnabled). This may throw an exception.
  38.                 VerifyState(false, false);
  39.  
  40.                 return MyHealthText;
  41.             }
  42.         }
  43.  
  44.         public override string CheckHealth(
  45.                     HealthCheckLevel level)
  46.         {
  47.             // Verify that device is open, claimed, and enabled.
  48.             VerifyState(true, true);
  49.  
  50.             // Your code here:
  51.             // check the health of the device and return a 
  52.             // descriptive string.
  53.  
  54.             // Cache result in the CheckHealthText property.
  55.             MyHealthText = "Ok";
  56.             return MyHealthText;
  57.         }
  58.  
  59.         public override DirectIOData DirectIO(
  60.                         int command, 
  61.                         int data, 
  62.                         object obj)
  63.         {
  64.             // Verify that device is open.
  65.             VerifyState(false, false);
  66.  
  67.             return new DirectIOData(data, obj);
  68.         }
  69.         #endregion // PosCommon overrides
  70.         protected override PrintResults PrintNormalImpl(PrinterStation station, PrinterState printerState, string data)
  71.         {
  72.             throw new Exception("The method or operation is not implemented.");
  73.         }
  74.         protected override void ValidateDataImpl(PrinterStation station, string data)
  75.         {
  76.             throw new Exception("The method or operation is not implemented.");
  77.         }
  78.  
  79.     }
  80.  
I register this with posdm in the name "Printer"

This is my application.
Expand|Select|Wrap|Line Numbers
  1. PosExplorer ex = new PosExplorer();
  2.             DeviceInfo d = ex.GetDevice(DeviceType.PosPrinter, "Printer");
  3.             PosPrinter printer = (PosPrinter)ex.CreateInstance(d);
  4.             printer.Open();
  5.             printer.Claim(1000);
  6.             printer.DeviceEnabled = true;
  7.             //printer.PrintNormal(PrinterStation.Receipt, "SSSSSS");
  8.  
  9.             printer.Release();
  10.             printer.Close();
  11.  
this PrintNormal method giving me an error saying "The receipt station is not present". I cannot figure it out. Please help me on this.

and if I want to open the cash drawer, can I use the printnormal method for that. something like "printer.PrintN ormal(PrinterSt ation.Receipt, "ESC /27,112,0,25,250 ");"

I'm really confused.
Oct 22 '08 #1
3 6787
Curtis Rutland
3,256 Recognized Expert Specialist
I fixed your code tags. They end with [/code]
Oct 22 '08 #2
Geeshan
2 New Member
Hi I overcome the problem with setting

Properties.CapR ecPresent = true;

But now it give me another error.
Expand|Select|Wrap|Line Numbers
  1. System.Exception: The method or operation is not implemented.
  2.    at IndexPrinter.IndexPrinter.PrintNormalImpl(PrinterStation station, PrinterState printerState, String data)
  3.    at Microsoft.PointOfService.BaseServiceObjects.PosPrinterBase.OutputRequestHandler(OutputRequest Request)
  4.    at Microsoft.PointOfService.Internal.PosCommonInternal.ProcessOutputRequest(OutputRequest request, Boolean asyncOperation)
  5.    at Microsoft.PointOfService.BaseServiceObjects.PosPrinterBase.ProcessRequest(PrintOperation operation)
  6.    at Microsoft.PointOfService.BaseServiceObjects.PosPrinterBase.PrintNormal(PrinterStation station, String data)
  7.    at IndexPrinter.IndexPrinter.PrintNormal(PrinterStation station, String data)
  8.    at TestApplication.PosPrinterScreen.PrintButton_Click(Object sender, EventArgs e)
  9.  
  10.  
I include this code in the class

public override void PrintNormal(Pri nterStation station, string data)
{
base.PrintNorma l(station, data);
}

But it give me the same error. please help
Oct 26 '08 #3
Robskew
1 New Member
Geeshan, did you ever solve this problem??, because I run into the same errors...
Jun 8 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
22293
by: Patrick Herb | last post by:
Hello, I'm trying to print the content of a RichTextBox from my VB 6 app. What I want is that the CommonDialog shows up, the user selects a printer and the content of the RichTextBox prints to the selected printer. I'm not concerned about the text format. What I tried is something like this CommonDialog1.ShowPrinter
1
10950
by: Bruce Adams | last post by:
I am using VB6 SP6. I have an application that prints charts. Specifically, it prints line charts of plant process information nightly. The code is a mix of API calls and Printer methods. I am currently migrating to a new PC running XP. The charting application is hanging on a single line of code: Printer.Orientation = vbPRORLandscape It throws an error '484', "Problem getting information from the printer. Make sure printer is set up...
0
3264
by: KohlerTommy | last post by:
In my application I need to give the user the ability to print duplex if the selected printer supports duplex printing. Many of the printer options do not make much sense in my application, and many of the settings in the common printer dialog would have a negative impact on my printing process. To handle this strict printing constraint on which my application imposes I do not want to show the common print dialog. I want to be able to...
0
3649
by: James Griffiths | last post by:
Here is a report I've written about a printing problem that is being experienced by a particular company for whom I had developed a A97 system. After upgrading to Win XP and AXP, some printing problems have arisen. My investigations show that it is not related to the particular system I developed. but is affecting Access in general. So, has nothing to do with reports being set to print to a default printer (which they all are) or to a...
1
9925
by: David Trivette | last post by:
I was wondering if anyone could help me with a MS Access 2002 issue I'm having. Problem - I created a db in Access 97 which worked just fine for several years. In the db the user can generate reports straight to a printer after a query has run. The user of this db just got a new computer with Windows XP and Access 2002. Now when the user runs the report the following error message is displayed:
5
7114
by: Hank | last post by:
My Access 2000 code has been running for several years in our main plant. Now we need to install it, as a stand-along application, at remote sites, some of which are out of state. My problem is the printer destination for special reports such as stickers and mailing labels. The Mailing Label report is, of course, designed here for a specific printer (Mailing Label). At another site, the name could be completely different. Other than...
1
4442
by: akhosravi4703 | last post by:
I'm having a problem with an application I pushed out recently. First, some background The application was made with Access 97 (unfortunately I'm stuck with this older version for the moment) The app is compiled into an MDE on a network drive from which several users access it in one location I'm an entry-level programmer, so please frame your answers for less experienced =)
0
1382
by: Mark | last post by:
Hello, I have a VB6 Project that uses an ini file to save selected printer settings for several forms. The program allows users to select the printer on their work station for printing forms. If a printer is not selected for a particular form, the user is prompted to select a printer. The program saves the printer selections to an ini file. THE PROBLEM: This program works well most of the time. On occasion, a specific printer...
1
2357
by: groulder | last post by:
hi all, i have a problem with a network database that's used by a lot of people. people are finding, they will start the database, and if the mouse is moved over the print icon, the tooltip appears to show which printer it will print to as normal. this printer however is a printer that the user doesn't even have installed.
9
10277
by: id10t error | last post by:
Hello, I am going to be using a Symbol WT4090 to scan items. I need to printer a tag from the Zebra ql320 plus. I am trying to do this is Visual basic 2005. Does anyone know and good site to find out how to do this. I have looked everywhere i know with no luck. Thank you in advance for your help.
0
8269
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8711
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8642
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8368
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8512
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5576
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4094
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2630
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1515
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.