Problem : VFP command to open cash drawer

Problem : VFP command to open cash drawer

hi, i have a cash drawer connect to a Epson TM U220 printer using RJ-11. The printer is connected to the PC using parallel port.  I want to have control over when the drawer can be opened.  I tried below commands but it does not work.

try 1
—-
SET PRINTER TO COM2, 9600, N, 8, 1
set printer on
ncount = 1
?? ‘ ‘ + CHR(nCount)
set printer off
set printer to default

try no 2
————-
set printer on
?? chr(27)+chr(112)+chr(0)+chr(50)+chr(250)
set printer off
set printer to default

please advise what is the correct command to use for opening the drawer


Solution : VFP command to open cash drawer

Try:

SET PRINTER TO COM2, 9600, N, 8, 1
??? CHR(27) +CHR(112)+CHR(48)+CHR(25)+CHR(250)
SET PRINTER TO DEFAULT

[Or, if you believe the second to last sequence should be CHR(50), use that instead.]