CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Deploying Windows Server 2008 with System Center
  • Remote Desktop Protocol Performance Improvements in Windows Server 2008 R2 and Windows 7
  • The Microsoft Dynamics CRM Security Model
  • SQL Server Modeling Services with Microsoft Visual Studio 2010 Beta 2

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Visual Basic Programming > Visual Basic .NET
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Visual Basic .NET Microsoft Visual Basic .NET and related questions.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old November 10th, 2009, 10:27 AM
    QuinnJohns QuinnJohns is offline
    Member
     
    Join Date: Jul 2005
    Location: Louisville, KY
    Posts: 68
    QuinnJohns is on a distinguished road (20+)
    (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
    Reply With Quote
      #2    
    Old November 10th, 2009, 08:08 PM
    dglienna's Avatar
    dglienna dglienna is offline
    ex MVP - Visual Basic
    Power Poster
     
    Join Date: Jan 2006
    Location: Chicago, IL
    Posts: 10,288
    dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+)
    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!
    Reply With Quote
      #3    
    Old November 10th, 2009, 10:31 PM
    QuinnJohns QuinnJohns is offline
    Member
     
    Join Date: Jul 2005
    Location: Louisville, KY
    Posts: 68
    QuinnJohns is on a distinguished road (20+)
    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.
    Reply With Quote
      #4    
    Old November 12th, 2009, 12:50 AM
    dglienna's Avatar
    dglienna dglienna is offline
    ex MVP - Visual Basic
    Power Poster
     
    Join Date: Jan 2006
    Location: Chicago, IL
    Posts: 10,288
    dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+)
    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!
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > Visual Basic Programming > Visual Basic .NET


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 01:24 PM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.