Results 1 to 7 of 7

Thread: Understanding the use of DWORD

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2010
    Posts
    2

    Understanding the use of DWORD

    Hello, I am a newbe in the use of VB
    My goal is to read a data streaming from a machine...
    the streaming is divided in tre main parts,
    the first is a 10 byte array that declare the length of the second and third part.
    The second one, the header, is a 22 DWORD (*32bit) ( 88 byte ) structured of mixed data types.
    I can easly read the value inside this header when the DWORD contains just one information using something like:
    Code:
            For counter = 0 To 21
                For i = 0 To 3
                    vettore_appoggio(i) = data(10 + i + counter * 4)
                Next i
                header(counter) = System.BitConverter.ToUInt32(vettore_appoggio, 0)
            Next counter
    My problem starts because some of these DWORD contains several indipendent informations, for example
    DWORD #4 [ channel 2 peaks 31..16] [channel 1 peaks 15..0].
    For what I understood the first 16 bits ( so 2 bytes) are used to store the information of the first channel , while the second 16 bits are used for the second channel, I tryed converting the first 2 byte with
    System.BitConverter.ToUInt16()
    but without success.
    Can someone explain me what to do and how these numbers are supposed to be stored?

    Thank you so much.
    Last edited by Hack; Jun 16th, 2010 at 10:39 AM. Reason: Added Code Tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width