Basically the code has 8bit values in each InputPacketBuffer I want to concatenate them 2 by 2 and then display the 32 16bit values (that are in DataReceive array).
The received values in txt aren't the values I want.
Although label1 the value Data is correct.
Do I need to transform the values in characteres??
How do I do it?
And to present them in a graph plot directly in visual studio? Which library do I use?
The problem is line 18. This way you write 2 * sizeof(DataReceive) and that's not what you want (do you always have the whole array filled?) -> fwrite(DataReceive , 1, sizeof(DataReceive) , pFile );
The next issue is the byte order if unsigned short. How do you read the stored data?
And to present them in a graph plot directly in visual studio?
size_t fwrite ( const void * ptr, size_t size, size_t count, FILE * stream );
Parameters
ptr
Pointer to the array of elements to be written.
size
Size in bytes of each element to be written.
count
Number of elements, each one with a size of size bytes.
stream
Pointer to a FILE object that specifies an output stream.
DataReceive is an array of 32 shorts(each short 16bits/2bytes). So I've selected 2 because each element has 2 bytes.
Each element of DataReceive has 16 bits which correspond to the value from a 16bit-ADC.
I want to put this values in ints in a txt.
The second issue, is I want to show the values in a graphic-> the 32 values. One way is to pic up the values from the txt and transport them to other program like matlab. The better solution was showing a graphic directly from vs c++ 2008.
Using the function fprint, I've achieved the Data in the txt. =)
If anyone knows about a library which I could display the values in a graphic in VS C++ I would apreciate.