I'm running on Win 95 with VFP 5. As I use a timer and set the property of
Interval=16.
Do I need to increase the Interval value so that the delay is longer before
I read from the
Comm Port again?
I'm receiving the status data from a moving machine that will feedback
messages of the
movement status whether is it successful or not.
I wonder what will happen when I first read the comm port, then close it.
Next if I reopen
the comm port will the oncoming data still stay/waiting there for me to
read? Thanks.
>What operating system are you using ? Following Barbra's suggestion the
buffer does clear, under NT4.0 it does not and that is why I open and close
the port to clear the buffer. What information are you receiving ?
>
>>Any more advise? What shall I do? Pls help...Thanks. ;-(
>>
>>
>>>
>>>Yes, you are correct, I can use this because I am reading from an
>>electronic scale that is providing a continuos stream to the serial
port. I
>>return the input from the buffer to a string and can then parse for the
>>begining character of the string.
>>>
>>>>By using PortOpen to clear the Input buffer doesn't sounds right.
>>Because I
>>>>wouldn't
>>>>know when is the last data sent from the serial port? Closing the port
>>>>might cause
>>>>lost of data, do you agree with me, Ian Johnston? Any other
alternative?
>>>>Thanks.
>>
>>>>>
>>>>>>I managed to send data out to serial port by using MSComm control.
>>>>Thanks.
>>>>>>I used the INPUT property to receive data from the serial port, it
>>does
>>>>>>read, but when I read the 2nd time it is the same message.
>>>>>>
>>>>>>Anyway to clear away the previous read data, as I'm using the
>>>>>>Timer to perform read at time interval. Pls advise, thanks.
>>>>>
>>>>>The way the documentation sounds calling input is suposed to clear
the
>>>>buffer but it does not. I use portopen to open and close the port this
>>will
>>>>clear the buffer and reread the serial port.
>>>>>
>>>>>Hope this helps.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement