Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Retrieving Weight From Scale
Message
 
À
17/09/1999 12:56:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00266005
Message ID:
00266112
Vues:
20
>Any suggestions on how to retrieve a weight from a scale connected to a COM port. We are using VFP5. The scale is a Weightronix PC820. Would greatly appreciate any help on this!!!

Here is a very simple example of reading from a com port with MSCOMM
The following opens a port, read 10 thousand times or until an "A" is encountered.
* load mscomm
oComm = CREATEOBJ('MSCOMMLib.MSComm')
* Open and Initialize COM port #1 for use
oComm.CommPort = 1
oComm.Settings = "9600,N,8,1"
oComm.InputLen = 0
oComm.PortOpen = .T.

FOR i = 1 to 10000 
	oComm.inputlen = 1
	lnChar = oComm.input
	IF lnchar = "A"
             EXIT
	ENDIF
ENDFOR

* Close the port
oComm.PortOpen = .F.
release oComm
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform