Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Retrieving Weight From Scale
Message
 
 
To
17/09/1999 12:56:51
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00266005
Message ID:
00266112
Views:
22
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform