Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RS232 Programming
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00036472
Message ID:
00036721
Views:
36
>Hi all,
>
>Does anyone have any information on the proper way to program RS232 stuff? I'm writing an interface using MSCOMM32.OCX and need to know if I'm doing it right. The main question I have is what is the best way to monitor the comm port? Right now, I just wait for the OnComm event to fire and the process what's in the buffer, but sometimes, I don't get all the data at once, sometimes it's split up, and I'm wondering how to make sure I get it all when I do lcInputBuffer = CommCtrl.Input.
>
>Thanks,

Hi Jim,
One of the traps of MSComm is that OnComm event does not always fire when VFP is looping through method code. You some times have to place DOEVENTS in looped code, to give MSComm events. This is tricky, because DOEVENTS includes all windows events, and it may slow your code drastically. Remember also, that you are responsible for checking overflow events in your code. This is probably the most overlooked coding, that causes missing data.

Good Luck,

HTH
Glenn
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform