Dec-11-2018, 05:28 PM
Thanks for the response!
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.
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!!!
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!!!