Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Serial Communication under Windows
Message
 
À
24/02/1997 02:23:38
Narendra Lilaramani
Gentech Business Machines Ltd
Ahmedabad, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00019822
Message ID:
00021812
Vues:
66
>>>>>>
>>>>>>Ya Tom,I have tried with buffering(size ranging from 10 bytes
>>>>>>to 30000), but in some cases, if I don't read char by char & give reply in time to the device, it generates an error & starts negative response. In this case I face more trouble. To give u an example say device sends ENQ & then waits for some
>>>>>>time (say few milisecs), now during this if I don't give answer
>>>>>>It again sends ENQ, so now if I read from buffer one char & reply the second char is also ENQ, where as for me after I send a reply it should be STX). Also I have to perform Check sums etc on the data.
>>>>>
>>>>>Narendra
>>>>>
>>>>>Whoops! Anyway...
>>>>>
>>>>>Maybe you should read the buffer in a LIFO manner? Just a suggestion.
>>>
>>>Yes,I do the same thing. But I have faced foll situation.
>>>Say in my control I have Rthreshold (Receive threshold) =1, so control should trigger OnComm event as soon as a character arrive. But when I read input with Control.Input property I get more then one character.
>>>This is because MSCOMM does make sure that it does not lose any character, but in my case its a problem.
>>>
>>>Narendra
>>
>>Narendra,
>>
>>The Rthreshold is the trigger for the OnComm event, not the control of the characters. Set control.InputLen=1 before reading the Input property.
>>
>>HTH
>Yes, I have done that. But it accounts some delays which I don't know why? Thanks anyways. I have made fairly stable routine in VB & PB. It works OK while running in Foreground. But as soon as I load Word or Excel when the Process is running, OnComm event does not fire until Word/Excel is loaded in which case again I lose control of the port. But I think this is the compromise I have to make, Isn't it?
>
>Thanks again.

I have not experienced this difficulty in VFP or VB. If you are using MSComm32 in VB, there is little difference. VB sample code shows doevents() VFP does not have sample code, and DOEVENTS is frequently overlooked. This may be your trouble when loading other apps. Remember that DOEVENTS is *all windows events* so carfully consider placement.
Glenn
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform