Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MSComm taking a long time
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Versions des environnements
Visual FoxPro:
VFP 8
OS:
Windows 2000 SP2
Divers
Thread ID:
01157804
Message ID:
01157827
Vues:
25
>>Viv,
>>
>>>It's not assigning a variable - it's sending the string to the transmit buffer. I guess if you want it to go faster you need a faster baud rate...
>>
>>Correct, but only to a point. Try the following:
>>
>>sendstart = SECONDS()
>>this.mscomm1.output = SPACE(100)
>>buffcount  = this.mscomm1.outBufferCount
>>sendend = SECONDS()
>>outputtime = sendend-sendstart
>>
>>
>>buffcount wil always be 0. Control doesn't return to VFP until the entire output buffer is empty.
>
>ouch :(
>
>the device only seems to operate at 19,600 .
>The buffer size is the vast majority of the time between 75 and 115 characters .
>So now I'm wondering:
> we are polling the device for an ACK , could we short circuit the app by just checking the mscomm object to see if the OUTPUT all went out?

As far as I can tell, once you OUTPUT, you are hung until the buffer is empty. So in effect, you know it went when you can continue to process. A bug IMO. Once your strings exceed the size of the outbuffer, then things begin to work as you might expect - meaning, a subsequent read of the outbuffercount will show some value other than 0.

I think your polling for an ACK would be the only sure way to know that the send completed successfully.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform