none
Claim BIXOLON Printer in POS.Net does nothing! RRS feed

  • Question

  • Hello there.

    I am currently developing a POS application in WPF, I'm trying to use POS for Net 1.14.1 to comunicate with my BIXOLON SRP-350plusIII printer without success.

    I have installed the OPOS driver given by BIXOLON and configured the printer. With the OPOS utility I can print test pages, also I have used the Sample Application -> TestApp included in the SDK for POS Net and everything works fine.

    I don't know why in my WPF app I can't connecto to the printer, the problem itself is at the momment of Claiming the device, in this line the app just does nothing, no exception, nothing just stills and all of a sudden it stops the debugging and I have to re run the application.

    This is the code that I am using:

    private void Print()
            {
                PosExplorer posExplorer = new PosExplorer();
                DeviceInfo deviceInfo = null;
                PosPrinter posPrinter = null;
    
                string test = "test print 1\n";
    
                try
                {
                    deviceInfo = posExplorer.GetDevice(DeviceType.PosPrinter, "PosPrinterTest");
                    posPrinter = (PosPrinter)posExplorer.CreateInstance(deviceInfo);
                }
                catch (Exception exception)
                {
                    throw exception;
                }
    
                posPrinter.Open();
                posPrinter.Claim(1000); // Here just hangs and does nothing
                
                if (posPrinter.Claimed)
                {
                    posPrinter.AsyncMode = false;
                    posPrinter.DeviceEnabled = true;
                    posPrinter.PrintNormal(PrinterStation.Receipt, test);
    
                    posPrinter.DeviceEnabled = false;
                    posPrinter.Release();
                    posPrinter.Close();
                }
            }
    Anyone knows what the problem might be?, as I told you.. I have already tested the printer in the OPOS utility by BIXOLON and in the TestApp in the SDK for POS Net, everything works fine.

    Or anyone knows another way to print Sale Tickets?

    Regards.

    Thursday, September 20, 2018 6:46 PM

All replies

  • Hi Jose Antonio Dominguez Lemus,

    Thank you for posting here.

    According to your description, I have some questions to confirm with you.

    1. How do you connect printer with your WPF application?

    2. Do you know how does Sample Application connect to printer? Do you use the same way?

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, September 21, 2018 8:50 AM
    Moderator
  • @Jose Antonio Dominguez Lemus,

    Make sure that you have closed the device connection in both the POS for .NET TestApp and the BIXOLON OPOS Utility when attempting to claim the device in your own code.  If there is an existing claim by another application it will block you app from claiming the device.

    You can also try the POSPrinter simulator that is available in the POS for .NET TestApp to verify that your code is working as expected.  If it is working with the simulator but not with the physical device then there must be some application that is holding an exclusive claim to the printer.

    Terry Warwick, Microsoft

    Monday, September 24, 2018 2:12 PM