Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MS Comm experts
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Miscellaneous
Thread ID:
00614817
Message ID:
00614846
Views:
26
Thanks!!! I took your code and put it in the OnComm Event method and tried to scan a bar code. I changed the comments to wait windows so I see what the values are returning. Every time I scanned the bar code it came back with commevent = 3 (Change in the CTS line.). It never returns a commevent = 2.

I am adding the input value to a form property and then parse the data left of a chr(13).

Any ideas?


>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!
DLC
"Use the Right Tool for the Job!"
davidandcynthia@email.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform