On Saturday, March 2, 2019 at 5:28:09 PM UTC+1, Robert Heller wrote:
> At Sat, 2 Mar 2019 14:50:33 -0000 (UTC) Rich <ri...@example.invalid> wrote:
>
> >
> > Foad S Farimani <
f.s.fa...@gmail.com> wrote:
> > > Hello guys,
> > >
> > > Where I want to read a series of numbers in CSV format. I tried solving it myself as I have explained here:
> > >
> > >
https://stackoverflow.com/questions/54935990/read-the-latest-line-of-a-serial-port
> >
> > Your solution page shows you were given the correct answer. But your
> > reply simply says "still does not work" (without revealing *anything*
> > about what change you made).
> >
> > How do you expect others to read your mind, remotely sense what changes
> > you made to your code without ever seeing it, and answer your question
> > when you hide all the information from them?
> >
> > And the answer you were given is correct. If you want to read a
> > channel (does not matter that it is a serial port) line by line, you
> > should use the "gets" command to do that.
> >
> > The "read" command does not do line-by-line itself (you would have to
> > further wrap line by line handling on top of the data read returns.
> > But why do that when "gets" already includes all that "line-by-line"
> > handling internally?
>
> The only possible "gotcha" is line termination: Tcl *should* do this
> automagically, but if the OP hardwires one scheme in the Tcl code and the
> uses another in the Arduino code, things won't work.
I'm not sure if I understand what you mean here. I actually used SimulIDe and com0com to generate the serial data. you may find more information here:
Would you please elaborate on why fileevent and maybe give some examples? can it be used to improve my solution here:
It would be great if you could provide more info. Maybe upload the codes on a Github Gist?