Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Serial Communication under Windows
Message
 
À
20/02/1997 11:38:19
Narendra Lilaramani
Gentech Business Machines Ltd
Ahmedabad, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00019822
Message ID:
00021322
Vues:
41
>>>>>I am facing problems writing "Serial Communication" routines under Windows.I am trying these routines since last few months and with my experience, I have come accross foll Conclusions/problems
>>>>>
>>>>
>>>>Narendra
>>>>
>>>>The market seems to definitely be moving towards Windows & away from DOS. Going to DOS will find you in a shrinking market.
>>>>
>>>>There are COMM utilities out the like SilverFox from SilverWare and others that will support the 16 bit environment. Plus eliminate a tedious learning curve. Look in the trade magazines for such products.
>>>>
>>>>Tom
>>>
>>>Thanks Tom but my problem is different. I have to write the
>>>routines bcz I am reading data from the device which has its own
>>>protocol & handshking that too very fast.I have to respond to
>>>each char received on port, (For example device first send ENQ
>>>then I reply with ACK, then it sends block of 4 chars, then i
>>>respond, then it sends header etc...). In this case I need a
>>>utility/OCX which is so fast & powerful that it generates
>>>interrupt as soon as char arrives at port.
>>>
>>>I tried MSCOMM16.OCX with VB4.0, it just does not work for me.and I don't think any utility can do this, bcz being a multitasking env,
>>>Windows does not give highest priority to COM port (ie a char
>>>just arrived at port & windows starts swaping between HDD & RAM,
>>>you can't do anything at this time). Its OK if
>>>you want to upload/download a large file in which case time is
>>>not that much critical.
>>>If you have come across any utility which is 100% perfect for
>>>these type of application,please reply soon.
>>
>>Narendra
>>
>>The only way to handle this is with a clever buffering scheme. Some products (the more effective) actually use a 3 part buffering scheme; The UART buffer, a low level buffer & a user buffer. You should be able to get away with 2 at the most; the UART buffer & maybe a low level buffer. Just watch the size of your buffers. Don't try to read each char from the port but read it from the buffers.
>>
>>HTH,
>>Tom
>
>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
Tom
--------------------------------
Tom O'Hare
407-299-4268 -- tom@redtile.com -- http://www.redtile.com/
Independent Programmer Using Visual FoxPro, Visual Basic & more...
Operations Manager -- Virtual FoxPro User Group (VFUG)
http://www.vfug.org/ -- tom@vfug.org
President -- Central Florida FoxPro User Group (CFFUG)
http://www.redtile.com/foxpro/
Universal Thread Most Valued Professional (MVP)
http://www.transformation.com/foxpro/
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform