2. C# Declaration Method
Public class PortAccess
{
[DllImport(“CashDrawer.dll”,EntryPoint = “Initial_CashDrawer”)]
Public static extern void Initial_CashDrawer();
[DllImport(“CashDrawer.dll”,EntryPoint= “GetCashDrawerStatus”)]
Public static extern bool GetCashDrawerStatus()
[DllImport(“CashDrawer.dll”,EntryPoint = “CashDrawerOpen”)]
Public static extern bool CashDrawerOpen(short num_drawer);}
Call Function
Open cash drawer1
PortAccess.CashDrawerOpen(0x01); //check cash drawer1 status
Open cash drawer2
PortAccess.CashDrawerOpen(0x02); //check cash drawer2 status
Bool bstatus;
bstatus = PortAccess.GetCashDrawerStatus(0x01);
bstatus = PortAccess.GetCashDrawerStatus(0x02); //Before get cash drawer status,
need to initial cash drawer first