*** QUOTE ****
Hello Experts
I have a couple of questions. One of our clients have bought a POS machine with the cash drawer and a pole display to display the gross amount. To display the gross amount i have to send a .txt file to the com port. My question is how to do it and how to send the Hex code to the com port to open the drawer.*** END QUOTE ***
Let say your cash drawer is connected to COM1, to open it,
You can issue command like below:
Set Device to Print
Set print to "COM1"
??? CHR(7)
*set print to
Set device to ScreeIf your client cash drawer is connected to the receipt printer's LPT port,
install GENERIC printer driver, rename to POSPRT or whatever according to your likings...
Set devi to print
set print to name "POSPRT"
??? CHR(7)
*set print to
Set devi to screenTo send display to Customer's Pole Display,
you can drop MSCOMM control to your form,
set its setting, baud rate, etc.
Or just use @ commands
*/* Check windows version
IF ALLTRIM(m.OSVER) = "Windows 5.02"
WITH THISFORM
.slscom.PortOpen = .T.
.slscom.Output = Space(21)
.slscom.Output = Space(26)
.slscom.Output = Alltrim(Transform(nQuantity))+' @ '+"B$"+" "+Allt (Transform(ySell,'9,999,999.99'))+CHR(11)+;
Substr(cDescription,1,20)+CHR(11)
.slscom.PortOpen = .F.
ENDWITH
Else
SET DEVICE TO PRINT
SET PRINTER TO "COM2"
@1,1 Say SPACE(20)
@2,1 Say SPACE(20)
@1,0 Say TRANSFORM(nQuantity)+' @ '+' B$ '+ ALLTRIM(TRANSFORM(ySell,'9,999,999.99'))
@2,0 Say Substr(cDescription,1,20)
SET PRINTER TO
SET DEVICE TO SCREEN
Endif
Code are tested with Windows XP.