Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reading com port continuously
Message
From
11/11/2005 11:08:13
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, United States
 
 
To
10/11/2005 18:20:02
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 6 SP3
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01067490
Message ID:
01067672
Views:
21
Zlatko,

Another option is to use a timer that calls the program to read data from your com port. You can do this once a second or so without taking a lot of cpu cycles.


>I use PORT.DLL for writing or reading some data to or from COM port from my VFP app. It works fine, but now I have to do some changes with reading.
>
>Well, reading COM port was a procedure user starts with click on button, the program opens com port, reads some bytes in a loop until some condition stops the procedure - like stopbyte comes or just a timeout. Now I have to do a program that should be able to read com port continuously all the time and react diferently on received bytes. It sounds to be like a windows service running in a background, but that's not the point.
>
>So - when I make my program to read com port in a loop, it works, but the CPU usage jumps to 100% and there is a constant hourglass on, so it's not what I want. I looked some communication software like HyperTerminal, and it worked more calm, so it's possible, but how?
>
>Is there any idea how to push the com port reading in a background of my VFP app?
>
>Thank's, Zlatko.
Previous
Reply
Map
View

Click here to load this message in the networking platform