Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Weird problem with MSCOMM
Message
From
24/03/2004 05:51:51
 
 
To
23/03/2004 08:59:36
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00888798
Message ID:
00889168
Views:
17
Hi Jim,

Thank for your advise.
BTW, I had two issues with MSCOMM

01) I want to make sure that I had sent the complete command to my device
before flushing it(i.e device reponse). I do so by setting SThreshold = 0, sent my complete command then set SThreshold = 1 to flush it. This is correct ?

02) My device seem to had received my command and reply, but the reply is not capture by my OnComm Event(). However, on switching off the device, the reply is then detected by my OnComm event of the MSCOMM. Any way to flush the buffer ?
Or do I had to set the inbufferSize smaller to solve this issue ?







>Whatever approach you use, you have no guarantee the device will ever respond, or in what time frame. In the case of your original code, you are testing for the presence of an ETX in the stream. I would use that to set a form property to TRUE, which would then run ASSIGN code for that property and display the result. If you start a timer with the command click, you can set a timeout period to display an error to the user. If the ETX arrives, great, disable the timer. Just one approach. I hate delay loops :-)
>
>>Hi Jim,
>>
>>Thank for your advise and code.
>>Beside using this way, any other better way to
>>wait for my device to reply before checking my
>>result ?
>>
>>I hope that after sending my command to MyFare reader,
>>I just wait for its reply and show it.
>>Maybe my code is not well written. I sure there must
>>be some better way to solve this issue.
>>
>>Thank you
Best Regards
Virusim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform