Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How To Read A Weight Scale (Cardinal) Through COM1 port
Message
 
À
18/02/2008 11:14:33
Raza Malik
Universal Accounting Software
Edgewater, New Jersey, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 7 SP1
Divers
Thread ID:
01293466
Message ID:
01293611
Vues:
46
>Hello Experts...
>
>I have weight scale attached to a COM1 port. Truck goes over the scale and it sends multiple readings to a VFP application via COM1 port. I can see the data comming through Hyper Terminal but I always get 0 through VFP application. I use the following code to capture the weight through COM1 port:
>
>
>	SET OLEOBJECT ON
>	oComm = CREATEOBJECT('MSCOMMLib.MSComm')
>	oComm.CommPort = 1
>	oComm.Settings = "1200,N,8,1"
>	oComm.InputLen = 0
>	oComm.PortOpen = .T.
>
>	II = oComm.input
>
>	=MESSAGEBIOX(II)
>
>	oComm.PortOpen = .F.
>
>	RETURN
>
>
>
>Can someone tell me what I am doing wrong ?
>
>Please...
>
>Thank You.
>
>Raza Malik

No, no that way.
InputLen is the length of the Input Buffer. I am not sure what happens when you set it to 0!
As Don said Put that ActiveX in a form.
In init of the form Open the port and catch all COM events in OnComm event of that ActiveX.
Make sure that ALL settings are right.
In destroy event of the form Close the port.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform