打開Pos收銀機錢箱
*!* 不同的型號/不同的接法有不同的處理
*!* 1.如果錢箱是接在 LPT 並口上的
Set Printer On
?? Chr(27) + Chr(112) + Chr(48) + Chr(50) + Chr(53)
*!* ?? Chr(27) + Chr(112) + Chr(10) + Chr(20) && 具體 ESC 代碼查詢有關資料
*!* ?? Chr(27) + Chr(112) + Chr(0) + Chr(50) + Chr(250)
Set Printer Off
Set Printer To Default
*!*
*!*
*!* 2.如果錢箱是接在 COM1 串口上的
Set Printer To Com1, 9600, N, 8, 1
Set Printer On
ncount = 1
?? ' ' + Chr(nCount)
Set Printer Off
Set Printer To Default
*!*
*!*
*!* 3.如果錢箱是接在 COM2 串口上的
Set Printer To Com2, 9600, N, 8, 1
??? Chr(27) + Chr(112) + Chr(48) + Chr(25) + Chr(250)
Set Printer To Default
*!*
*!*
*!* 4.直接發送控制碼到錢箱
*!* 首先創建一個打開錢箱控制碼的檔
Set Device To File O_drawer.Prn
@ 00,00 Say Chr(27) + Chr(112) + Chr(00) + Chr(50) + Chr(100)
Set Device To Screen
*!* 然後在你需要打開錢箱的時候,發佈下列命令即可
Copy File O_drawer.Prn To LPT1.DOS
*!*
*!*
*!* 5.採用 MSComm 控制項開錢箱
*!* 在命令按鈕上寫下面事件代碼
Thisform.olecontrol1.portopen = .T.
Thisform.olecontrol1.Output = "0000000000"
Thisform.olecontrol1.portopen = .F.
*!* MSCom 的 CommPort : 1 = COM1, 2 = COM2
*!*
*!*
*!* 6.採用 EPSON 的 OPOS ADK/SDK 開錢箱
_Screen.oFinApp.oCashDrawer.OpenDrawer()
This method waits until the Drawer Is closed
Local llDrawOpen As Boolean
Local lnTimeStart As Number
Local lnTimeNow As Number
*!*
*!* ---------------------
*!* Initialise Variables
*!* ---------------------
llDrawOpen = _Screen.oFinapp.oCashDraw.DrawerOpened
lnTimeStart = Val(Sys(2))
Do While _Screen.oFinApp.oPosPrinter.State = OPOS_S_BUSY
Inkey(0.01)
Enddo
_Screen.oFinapp.oCashDraw.StatusUpdateEvent()
Do While llDrawOpen
lnTimeNow = Val(Sys(2))
lnSecondsGone = lnTimeNow - lnTimeStart
Do Case
Case lnSecondsGone < 2
Wait Clear
Thisform.lblWarning.Visible = .T.
Case Between(lnSecondsGone, 2, 3)
Thisform.lblWarning.Visible = .F.
Case lnSecondsGone > 3
lnTimeStart = Seconds()
Endcase
llDrawOpen = _Screen.oFinapp.oCashDraw.DrawerOpened
Enddo
Thisform.lblWarning.Visible = .F.
Return .T.
*!*
*!*
*!* 7.如果錢箱是接在 USB 上的
*!* 或者採用列印共用的映射方式
*!* 或者採用特別動態庫
留言列表