The following forum(s) have migrated to Microsoft Q&A (Preview): Developing Universal Windows apps!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

 locked
[UWP][C#] Connect CashDrawer by OPOS BRIDGE, that not working RRS feed

  • Question

  • I've been trying to integrate Cash Drawer support into a Windows Universal App using the Windows.Devices.PointOfService namespace.

    I've downloaded the Cash Drawer sample available available here:  

    https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/CashDrawer

    The cash drawer sample compiles and runs fine, but when I hit 'Initialize Drawer', it tells me "Cash drawer not found.  Please connect a cash drawer."

    Essentially, CashDrawer.FromIdAsync(); throw an exception "Exception from HRESULT: 0x8007001F"

    I have a cash drawer connected to the device, and I can open it with the vendor's OPOS Cash Drawer Test Utility.
    • Edited by Hunnkun Friday, June 2, 2017 9:13 AM
    Friday, June 2, 2017 9:11 AM

All replies

  • Hello Hunnkun,

    Please check the following page first: https://docs.microsoft.com/en-us/windows/uwp/devices-sensors/cash-drawer Maybe you need to check whether you've installed the latest OPOS driver. By the way, please also provide details about your Cash Drawer for us.

    Best regards,

    Barry


    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.

    Monday, June 5, 2017 6:47 AM
  • Hello thank you for your reply.

    The cashdrawer connect to printer through the dk port, and printer connect to pc through the usb. My uwp application can call printer through the opos driver.


    • Edited by Hunnkun Monday, June 5, 2017 10:17 AM
    Monday, June 5, 2017 10:12 AM
  • Hi Hunnkun,

    Do you have an OPOS Service Object installed for the Cash Drawer? Please check out the entries below HKLM\SOFTWARE\OLEforRetail to determine if Cash Drawer service objects are present. 
    A pre-requisite of using the OPOS Bridge is that the device must be working in OPOS before it can work in UWP. Please also confirm that it can be accessed using a Win32 test app or the POS for .NET test app that is included in the samples when you install the POS for .NET SDK. If you have multiple Cash Drawer service objects installed, FromIDAsync may be trying to access the wrong one since OPOS does not have any support for PnP.

    Besides, could you please share a tracelog for us by using the following steps: 

    Please run the following before your repro:

    Logman start oposdrv -p {79b43fb6-cf74-4806-a2c5-ac89e581c1d1} 0xFFFFFFFF 255 -o oposdrv.etl -ets

    Followed by the following after the repro:

    Logman stop oposdrv -ets

    Oposdrv.etl will contain a detailed log of what the oposdrv is doing when attempting to connect to the OPOS service object. It sounds like there may be an issue while handshaking with the CashDrawer service object, leading to an error being returned and resulting in the generic failure exception thrown.

    Thanks,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thursday, June 15, 2017 3:07 AM
  • @Hunnkun,

    We have discovered an issue with some OPOS Service Objects for POSPrinter and Cash Drawer that must be run in the same address space and since you are connecting the Cash Drawer to the DK port on a POSPrinter which also requires an OPOS Service Object, I am pretty sure this is the same issue.  The fix will be available in Windows 10 Insider Releases before the end of August.  I apologize for not being able to be more specific about the timing. 

    Terry Warwick
    Microsoft

    Wednesday, August 2, 2017 4:29 PM