??? 11/28/05 12:15 Read: times |
#104248 - COM1 Read the firtst value only. Responding to: ???'s previous message |
Kurnia Brahmana said:
Hi,
I wrote a data logger via COM1 in VC6 MFC FormView as "Code Guru's homepage" suggessted. It works just fine if the input from another computer like hyperterminal. But when the data come from AT89s52, the program read only the first value. If "MessageBox("Click here.")" is added, then the new value will be read if the "OK" has been clicked. This instruction like to emptyied the input buffer and may receive a new one. The program should read the new value whenever input buffer receive 1 character or "m_comm.GetCommEvent==2" It seems to me that the input buffer could'nt get empty even if "m_comm.GetInput()" has been executed. Please some one may have experience on that case, would like to show a clue to solve the problem, thank you. Thank you in advance, Kurnia Brahmana Hi, Sol1: Pl. check your program in 89s52. You may have given some type acknowledgement, or your 89s52 may be expecting a character from serial port. Sol2: If there is no such thing as acknowledgment, Pl. include a staement in your c program, which is equivalent to.. Doevents .. in visual basic. ( if you are in an endless loop, then it is necessary for you execute doevents every time, the loop is executed once, to register mouse click or any other process to be executed .. ) .. krishnaiah. |
Topic | Author | Date |
COM1 Read the firtst value only. | 01/01/70 00:00 | |
COM1 Read the firtst value only.![]() | 01/01/70 00:00 |