I have a cash drawer (Model = PSHOP CD4141) and POS PC (Posbank Apexa G). I can open cash drawer via XPrinter Q900 after or before printing receipt (there is an option in printer settings). But i need to open drawer without printer. There are RJ11 ports on the POS PC. I tried this code:
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.PointOfService;
namespace POS
{
public class CashDrawerClass
{
CashDrawer myCashDrawer;
PosExplorer explorer;
public CashDrawerClass()
{
explorer = new PosExplorer(this);
DeviceInfo ObjDevicesInfo = explorer.GetDevice("CashDrawer");
myCashDrawer = explorer.CreateInstance(ObjDevicesInfo);
}
public void OpenCashDrawer()
{
myCashDrawer.Open();
myCashDrawer.Claim(1000);
myCashDrawer.DeviceEnabled = true;
myCashDrawer.OpenDrawer();
myCashDrawer.DeviceEnabled = false;
myCashDrawer.Release();
myCashDrawer.Close();
}
}
}
But it doesn't work. Can anyone suggest how can i open cash drawer without printer?
I found the answer. As @kunif said, Apexa G comminucates with cash drawer on COM5 port. All i need simple Write() command. Following code works:
string port = "COM5";
using (SerialPort serialPort = new SerialPort(port))
{
serialPort.Close();
serialPort.Open();
serialPort.Write("\x001B@\x001Bp\0.}");
serialPort.Close();
}