| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | Newsletters | VB Forums | Developer.com |
|
|||||||
| Visual Basic .NET Microsoft Visual Basic .NET and related questions. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
(VB.NET 2003) Handling Data Question
I'm currently working on a project where I am transmitting data from a comm device via the serial port and resorting the raw data (in binary) to its respective ascii values. The problem I'm facing is determing the most efficient method to accomplish my goal.
Essentially, I have 68 bytes coming in, the first and second bytes represent the page and packet number and the data itself ranges from 3 to 64, the remaining for my checksum. What I am needing to do is, grab 50 consecutive bytes per variable in my array, and that is where I'm confused. I have easily pulled my 3-64 bytes and stored that data to a string. I just don't know the most efficient method to accomplish my goal. Should I write directly to file all my data -- as there are like 8 pages, of 128 packet data. (All integers) To better illustrate: baseball data #1 0 0 2 3 4 1 5 2 3 4 ... n baseball data #2 I can capture the the first 50 by using a for-loop easily, but what would be the preferred method to track what data chunk I've taken? The more I think about it, I think I may just want to write to file, all my data, and then just take them back to back in 50 byte chunks. Is that the most efficient method? Thanks -Quinn |
|
#2
|
||||
|
||||
|
Re: (VB.NET 2003) Handling Data Question
Probably, but we don't know what you are doing with 50 byte chunks (or why you don't just STORE 50 byte chunks)
__________________
David CodeGuru Article: Bound Controls are Evil-VB6 101 Samples: VB & C# VS2008 Samples CodeGuru Reviewer 2006 Dell CSP 2006, 2007 & 2008 MVP Visual Basic If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!
|
|
#3
|
|||
|
|||
|
Re: (VB.NET 2003) Handling Data Question
Well, to be honest, the whole of the data is just integers.
I'm just needing to know the most efficient method to take 50 byte chunks at a time, out of n-bytes. Store? As in what method? A database? That may come eventually, as the resources I currently have won't allow for that function. I will also need to mention is that I can't backtrack for data. It is feeding it, at a constant rate, in binary. So, as the memory comes in, I'm needing to either write it to file then, or lose it. Any help or suggestions are greatly appreciated. |
|
#4
|
||||
|
||||
|
Re: (VB.NET 2003) Handling Data Question
If you can set the blocksize, it will be automatic. Otherwise, I'd serialize it, and then parse it into chunks
__________________
David CodeGuru Article: Bound Controls are Evil-VB6 101 Samples: VB & C# VS2008 Samples CodeGuru Reviewer 2006 Dell CSP 2006, 2007 & 2008 MVP Visual Basic If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!
|
![]() |
| Bookmarks |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|