Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Read through serial port com1
Message
 
To
27/09/2006 22:16:35
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01157734
Message ID:
01157740
Views:
32
Hi Shafid, long time no hear... Hope things are going well...

Anyhow, I've done COMM for integrating with a telephone PBX system. What I did was added an OLE control. Then when it pops up the control to add, I picked "Microsoft Communications Control, version 6.0" (on my machine). Once selected, it looks like a telephone sitting on a modem (red/green lights).

in the INIT() method, I did
This.PortOpen = .T.

in the DESTROY() method, I did
if This.PortOpen
This.PortOpen = .F.
endif

Set the properties of the comm control as you need.
COMMPORT = your port (ie: 1, 2 or whatever)
SETTINGS = something like you have... 9600,n,8,1


Finally in the ONCOMM method, I had code to capture the data feed from the PBX system.

*** OLE Control Event ***
IF THIS.CommEvent = 2 AND This.InBufferCount > 0
*/ If anything in buffer, immediately throw it into the FORM field
*/ or wherever you want to hold it until necessary end character reached
Thisform.MyTextbox.Value = Thisform.MyTextbox.Value + This.Input
ENDIF

Hope this gets you a good jump start.

Don




>Hi All
>I have a serial port barcode reader, Baud=9600, Par=N, Bits=8, stop=1. How can I get the reader to put the scanned reading into a selected field ?? Your help will be appreciated.
>Shafid
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform