serial communication too fast?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Marco Martin

    serial communication too fast?

    Hi,

    I'm writing a program in C# which logs data comming from a com port. the
    port is set up 8 bit, no parity, 1 stop bit (n-8-1), @ 38400 baud. I'm
    supposed to receive this data and simply display it in a listbox. No
    problem there. Once I start iterating through the data to do some
    manipulation though, it wont print to my listbox unless I put a break point
    in my code. Then I get some data printed. A few seconds later, the same
    thing happens, and I put a break point in the code again and more data gets
    printed. I'm thinking that the data is comming too fast, but I'm running on
    a P4 with 512M ram. It just doesn't make sense.
    The data comes in fine if I just take it in and print it (like on
    hyperterminal for example).

    any ideas?

    regards,

    marco


  • the man

    #2
    serial communication too fast?

    have your listbox get refreshed every few seconds
    (Listbox.Refres h())
    you can use a timer and on the tick event refresh the
    listbox.
    [color=blue]
    >-----Original Message-----
    >Hi,
    >
    >I'm writing a program in C# which logs data comming from[/color]
    a com port. the[color=blue]
    >port is set up 8 bit, no parity, 1 stop bit (n-8-1), @[/color]
    38400 baud. I'm[color=blue]
    >supposed to receive this data and simply display it in a[/color]
    listbox. No[color=blue]
    >problem there. Once I start iterating through the data[/color]
    to do some[color=blue]
    >manipulation though, it wont print to my listbox unless I[/color]
    put a break point[color=blue]
    >in my code. Then I get some data printed. A few seconds[/color]
    later, the same[color=blue]
    >thing happens, and I put a break point in the code again[/color]
    and more data gets[color=blue]
    >printed. I'm thinking that the data is comming too fast,[/color]
    but I'm running on[color=blue]
    >a P4 with 512M ram. It just doesn't make sense.
    >The data comes in fine if I just take it in and print it[/color]
    (like on[color=blue]
    >hypertermina l for example).
    >
    >any ideas?
    >
    >regards,
    >
    >marco
    >
    >
    >.
    >[/color]

    Comment

    • Marco Martin

      #3
      Re: serial communication too fast?

      Found an answer, I actualy put a thread.join(250 ms) and it solved the
      problem.
      "the man" <anonymous@disc ussions.microso ft.com> wrote in message
      news:04f801c399 b6$03fd85f0$a30 1280a@phx.gbl.. .[color=blue]
      > have your listbox get refreshed every few seconds
      > (Listbox.Refres h())
      > you can use a timer and on the tick event refresh the
      > listbox.
      >[color=green]
      > >-----Original Message-----
      > >Hi,
      > >
      > >I'm writing a program in C# which logs data comming from[/color]
      > a com port. the[color=green]
      > >port is set up 8 bit, no parity, 1 stop bit (n-8-1), @[/color]
      > 38400 baud. I'm[color=green]
      > >supposed to receive this data and simply display it in a[/color]
      > listbox. No[color=green]
      > >problem there. Once I start iterating through the data[/color]
      > to do some[color=green]
      > >manipulation though, it wont print to my listbox unless I[/color]
      > put a break point[color=green]
      > >in my code. Then I get some data printed. A few seconds[/color]
      > later, the same[color=green]
      > >thing happens, and I put a break point in the code again[/color]
      > and more data gets[color=green]
      > >printed. I'm thinking that the data is comming too fast,[/color]
      > but I'm running on[color=green]
      > >a P4 with 512M ram. It just doesn't make sense.
      > >The data comes in fine if I just take it in and print it[/color]
      > (like on[color=green]
      > >hypertermina l for example).
      > >
      > >any ideas?
      > >
      > >regards,
      > >
      > >marco
      > >
      > >
      > >.
      > >[/color][/color]


      Comment

      Working...