Python Forum
I need a serial device expert!
Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I need a serial device expert!
#3
Thanks for the response!

Quote:One thing that I notice is your baud rate is 9600.
If the data is being sent at 100 Hz, then the baud rate is fast enough to capture everything.

Haha yeah, I was playing with different baud rates to see if there was an effect. you can see that i commented out the actual baud rate of 460800. Although it didn't really seem to matter, as far as I can tell, what baud rate was set.

Quote:I think that you need to have the read routine running all the time in a thread, filling a FIFO (First in, First Out) buffer continuously as it reads.

Then you need another thread that will take data from the FIFO in chunks and transfer to either a process that will analyze it in whatever fashion you need, or to write the data to files of a certain size (starting a new one whenever sizes bytes are read. The data appears to have a well structured format, and I'm guessing each item is terminated with a newline. If this is the case, files should contain only whole records.

Now you can label the files with timestamps so that you know what order to process them in.

Finally, you can have multiple threads running that process the data. This will allow you to stay ahead of the flow.

I will definitely read up on this. I figured as much that there was a much smarter way to do this.

Can you by chance list a few commands that I can read up on or possibly elaborate more on running "multiple threads". Im not familiar with all the lingo, so I don't really know what a thread is haha.

Thanks for all the help!!! Big Grin
Reply


Messages In This Thread
I need a serial device expert! - by Caesars_10th - Dec-05-2018, 12:04 AM
RE: I need a serial device expert! - by Larz60+ - Dec-05-2018, 12:51 AM
RE: I need a serial device expert! - by Caesars_10th - Dec-11-2018, 05:28 PM
RE: I need a serial device expert! - by Larz60+ - Dec-11-2018, 08:07 PM
RE: I need a serial device expert! - by Larz60+ - Dec-14-2018, 02:58 AM
RE: I need a serial device expert! - by Larz60+ - Dec-14-2018, 12:05 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  pyserial/serial "has no attribute 'Serial' " gowb0w 9 4,406 Aug-24-2023, 07:56 AM
Last Post: gowb0w
  How would you (as an python expert) make this code more efficient/simple coder_sw99 3 1,833 Feb-21-2022, 10:52 AM
Last Post: Gribouillis
  Reading UDP from external device without device software ikdemartijn 2 3,449 Dec-03-2019, 04:29 PM
Last Post: Larz60+
  Display device details i.e connected with more than one device shintonp 6 5,374 May-10-2017, 06:00 AM
Last Post: shintonp

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020