Hi Friends,

I am basically a Oracle D2K programmer. I've worked a bit in VB a long time back. I need some help with com port data capturing. the data is comming continuesly. I need to capture it properly and extract the useful party of it.


VB Code:
  1. Private Sub Command1_Click()
  2.     MSComm1.CommPort = 1
  3.     If MSComm1.PortOpen = True Then
  4.         MSComm1.PortOpen = False
  5.     End If
  6.     MSComm1.PortOpen = True
  7. End Sub
  8.  
  9. Private Sub Command2_Click()
  10. Text1.Text = MSComm1.Input
  11. End Sub

I've used a very simple form with 2 command buttons and 1 text box

the 1st command button opens the port and command button 2 assigns the value of mscomm1.input to text1.text

the result which i get each time is

set1
-------------

':0 0000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000


set2
-----------------

':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 0000000000

set3
---------------
:0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000
':0 000000000000

as you can see there is a symetry in data but it can not be used directly as when the application runs real fast 1/100 times it also captures junk values. can anybody please suggest me how can I regularise the dataflow in such a way that I can extract the useful value from input everytime I press the command button 2

If you need any further information or details, please feel free to ask me.

Hope to get a reply soon

Warm Regards
Vivek Bajaj