How do I do that?. Do I need a .dll for RS-232 interface? Are the old
FOPEN(), FWRITE() and FREAD() still working for Win98 and VFP6?
Thanks in advance
Rick
"Cesar F. Manzano T." <cman...@avantel.net> wrote in message
news:#ehhOMBh$GA....@cppssbbsa02.microsoft.com...
I would suggest looking into a OLE for POS (OPOS) driver for this --
would make it easier to program, if they have one.
--
Garrett Fitzgerald
#INCLUDE "\Program Files\Microsoft Visual Studio\VFP98\stddsclm.h"
(Anyone who thinks I do anything vaguely resembling speaking for Microsoft
is sorely deluded...)
How to deal with serial ports and MSCOMM32.OCX ? read on
For the scale ...
************
(the trick is to wait)
*** cmdWeight.Click()
SET DECIMALS TO 3 && ** If not, it rounds the weight to 2
decimals
LOCAL el_peso, eran, ns
eran = SET( 'DECIMALS', 1)
WITH THISFORM.oleBascula && *** the name of the object MSCOMM32
ns = SECONDS()
.portopen = .T.
.inputlen = 20
DO WHILE SECONDS()- nS < 1 && ** A loop to read the COM port
.output = "W" + CHR(13) && ** An orden to the scale
&& (it's part
of the NCI protocol)
FOR x = 1 TO 100000 && ** Just waiting ...
ENDFOR
el_peso = .input && ** Here is the weight
measured
el_peso = RIGHT( el_peso, LEN( el_peso) - 1)
el_peso = VAL( LEFT( el_peso, 7))
IF el_peso > 0
THISFORM.txtPeso.Value = el_peso
EXIT
ENDIF
ENDDO
.portopen= .T.
ENDWITH
SET DECIMALS TO (eran)
For the scanner ...
************
(the trick is to use the OnComm event to let the data flow in alone)
*** In the Form Init method...
THISFORM.oleScanner.portopen = .T.
*** In the cmdExit.Click() ( exit button)
THISFORM.oleScanner.portopen = .F.
*** In the ONCOMM Event of the OLE object (THISFORM.oleScanner)
IF This.CommEvent = 2 AND This.InBufferCount > 0 && *** There is something
in the scanner !!
WITH THISFORM.txtClave
la_clave = THIS.input
la_clave = RIGHT( la_clave, LEN( la_clave) - 1) && *** I clean up an
"A" that I get (??)
.Value = la_clave
.Valid()
ENDWITH
ENDIF
Of course I validate that we are entering codes and the cashier does not use
buttons but F-( ON KEY LABEL F10
_ACTIVEFORM.cmdIniciar.Click())