Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MS Comm experts
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Titre:
Divers
Thread ID:
00614817
Message ID:
00614822
Vues:
31
hi David,

The following is a template I use for the values:
*** ActiveX Control Event ***
DO CASE
* Handle each event or error.
	* Events
	Case THIS.CommEvent = 1
		* SThreshold # of Characters to Transmit.
	Case THIS.CommEvent = 2
		* RThreshold # of characters Received.
	Case THIS.CommEvent = 3
		* Change in the CTS line.
	Case THIS.CommEvent = 4
		* Change in the DSR line.
	Case THIS.CommEvent = 5
		* Change in the CD line.
	Case THIS.CommEvent = 6
		* Change in the Ring Indicator.
	Case THIS.CommEvent = 7
		* An EOF character was found in the input stream.
        * Errors
	Case THIS.CommEvent = 1001  
		* A Break was received.
	Case THIS.CommEvent = 1002
		* CTS Timeout.
	Case THIS.CommEvent = 1003
		* DSR Timeout.
	Case THIS.CommEvent = 1004
		* Framing Error.
	Case THIS.CommEvent = 1006
		* Data Lost.
	Case THIS.CommEvent = 1007
		* CD (RLSD) Timeout.
	Case THIS.CommEvent = 1008
		* Receive buffer overflow.
	Case THIS.CommEvent = 1009
		* Parity Error.
	Case THIS.CommEvent = 1010
		* Transmit buffer full.
	Case THIS.CommEvent = 1011
		* Unexpected error retrieving DCB
ENDCASE
As far as the length of the input string, I would create a form property like "inbuffer". In the above "Case THIS.CommEvent = 2", just do a
THISFORM.inbuffer = THISFORM.inbuffer + THISFORM.yourcommcontrol.Input
Now test THISFORM.inbuffer for the terminating character of the scanned string. If found, process your data and clear the buffer.

>I am using the MSComm object to receive data from a bar code scanner. I need to be able receive different lengths of data from 21 to 185 characters. I also need to know what the CommEvent values mean. Any ideas?
>TIA!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform