Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RS232 Programming
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00036472
Message ID:
00036610
Vues:
26
>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,

Jim, I'm no expert, since I'm working on my first MSCOMM32 system, but I found it useful to store the input to a form property. I know that each 'message' will end with either chr(15) or chr(13) (hardware property), so I parse the value in the form property looking for each of these values. Then I cut the processed data off the form property, store it again and start all over. So far it's working fine. Before I did this, I kept getting partial messages in the input buffer. THen the buffer was emptied when I stored it to a variable and I was in a mess.

HTH
Barbara
Barbara Paltiel, Paltiel Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform