I have been trying to use the MSComm32.OCX to log input that is being sent to Com2 by another program. My goal is to store each line of data sent to the port as a record in a table.
1. I set the port settings and open the port open .init of the form and leave the port open.
2. I have a timer running every five seconds which appends the OLE Comm object's .INPUT to a table's MEMO field. I close and reopen the Com port to flush the buffer.
3. I then copy the memo field to a .TXT file using the COPY MEMO command. Into a separate table I append ('TYPE SDF') from the .TXT file. This helps prevent chopping off the 'lines' of data sent (approx. 80 characters).
It seems that my .Input buffer is always empty or I only grab pieces of data. A line of text is sent to the port approximately once every four seconds. I have played with the Rthreshold property of the OLE Comm object and the InputLen property (I tried both 0 and 1).
Any suggestions on methodology? Or are there samples of this same type of program?
Thanks!
1. I set the port settings and open the port open .init of the form and leave the port open.
2. I have a timer running every five seconds which appends the OLE Comm object's .INPUT to a table's MEMO field. I close and reopen the Com port to flush the buffer.
3. I then copy the memo field to a .TXT file using the COPY MEMO command. Into a separate table I append ('TYPE SDF') from the .TXT file. This helps prevent chopping off the 'lines' of data sent (approx. 80 characters).
It seems that my .Input buffer is always empty or I only grab pieces of data. A line of text is sent to the port approximately once every four seconds. I have played with the Rthreshold property of the OLE Comm object and the InputLen property (I tried both 0 and 1).
Any suggestions on methodology? Or are there samples of this same type of program?
Thanks!