我有一個合作伙伴技術CD7220-U 1.0客戶顯示器,我正在嘗試使用C#
開發POS系統。我需要使用客戶顯示器顯示單價和總金額。 所以我搜索了谷歌,並找到幾個解決方案,以顯示在顯示器上的文字。 這裏是我跟着鏈接,如何顯示文本並清除合作伙伴CD7220-UN客戶顯示器/杆式顯示器的文本
1)http://www.codeproject.com/Questions/67846/How-to-display-text-on-USB-Posiflex-Customer-Displ
2)http://www.codeproject.com/Tips/658377/PartnerTech-CD-POS-Customer-Display-NET-Class
在該示例(1)
using Microsoft.PointOfService;
private const string WelcomeMessage = "Welcome\r\n";
private PosExplorer posExplorer;
private LineDisplay posLineDisplay;
private DeviceInfo posLineDisplaydevice;
public void LineDisplayUnit()
{
this.posExplorer = new PosExplorer(this);
this.posLineDisplaydevice = this.posExplorer.GetDevice("LineDisplay", "POSIFLEX_LINEDISPLAY");
try
{
this.posLineDisplay = (LineDisplay)this.posExplorer.CreateInstance(this.posLineDisplaydevice);
this.posLineDisplay.Open();
this.posLineDisplay.Claim(1000);
this.posLineDisplay.DeviceEnabled = true;
this.posLineDisplay.DisplayText(WelcomeMessage);
this.posLineDisplay.DisplayTextAt(2, 1, this.LeftAlign("Amount", 7) + this.RightAlign(this.GrandTotalAmount.ToString("0.00"), 12));
this.posLineDisplay.Close();
}
catch (Exception)
{
}
}
我有以下例外
例如,我可以將文本發送給客戶顯示。但我無法清除屏幕。
下面的代碼
public void WriteSomethingRedToPrinterThroughDisplay()
{
cUSB.OpenPort(); // Open the USB Port
cUSB.WritePort(Strings.Chr(12)); // Clear pole display
cUSB.WritePort(Strings.Chr(27) + Strings.Chr(61) +
Strings.Chr(1)); // Send print through pole display
cUSB.WritePort(Strings.Chr(27) + Strings.Chr(64)); // Initialize printer
cUSB.WritePort(Strings.Chr(27) + Strings.Chr(114) +
Strings.Chr(1)); // Select Red color to print
cUSB.WritePort(string.Format("{0,-10}{1,7:-0.000}
{2,10:0.00}{3,13:-0.00}", tempitemid, tempunits,
tempunitprice, tempsubtotal) + Strings.Chr(10)); // Print text and new line
cUSB.WritePort(Strings.Chr(27) + Strings.Chr(114) +
Strings.Chr(0)); // Set color to default Black
cUSB.WritePort(Strings.Chr(27) + Strings.Chr(61) +
Strings.Chr(2)); // De-select printer and enable pole display
cUSB.ClosePort(); // Close the USB Port
}
請給我正確的教程或正確的方法來顯示在顯示單元的文本。您的幫助將受到高度讚賞。
感謝您的幫助。它運作良好。非常感謝您的幫助。 – PasinduM 2014-08-29 14:54:36