I'm not a C++ programmer in the real sense of it, but my project involves gathering some data, store the data in memory with time stamp and later upload to the PC where a C++ algorithm will be used to manipulate it and then produce a graph of the manipulated data.
I can gather the data using assembly language and store to memory, well in ASCII (HEX).
(1) I do not know how to start/initiate my data upload to the PC
(2) I do not know how to manage the HEX data once it gets to the PC.
(3) Do I need to convert data to Decimal before I can run algorithms on it?
I'm really stuck here.. Based on my requirements? can anybody make a suggestion that I can consider for my implementation please?
Is there any Textbook that I might find useful?

Recommended Answers

All 4 Replies

>1) I do not know how to start/initiate my data upload to the PC
First you need to have a clear idea of what 'upload' means to you. Are you gathering the data on another system and transferring it through a network to the PC? Are you reading from a file, from a process, from a socket? Upload to what? A file? A memory map? A pipe?

>(2) I do not know how to manage the HEX data once it gets to the PC.
If it's in text format then depending on the needs of the C++ program, you need to convert as necessary.

>(3) Do I need to convert data to Decimal before I can run algorithms on it?
If the data is in text format as you said, you need to convert it to binary so that it can be treated as numeric values rather than character values. Once in binary format, decimal and hexadecimal are nothing more than representation differences, and internally are identical.

Hi,

If you need to upload the data later to the PC where algorithm resides then where were it in the first placee ? Anther computer, or a data acquisition device ? What is the type of connection between the hardware the data comes from and the PC ? In which format the HEX coded data is ? And, yes you need to convert the data from ASCII based HEX presentation to an integer type.

Loren Soth

>1) I do not know how to start/initiate my data upload to the PC
First you need to have a clear idea of what 'upload' means to you. Are you gathering the data on another system and transferring it through a network to the PC? Are you reading from a file, from a process, from a socket? Upload to what? A file? A memory map? A pipe?
>(2) I do not know how to manage the HEX data once it gets to the PC.
If it's in text format then depending on the needs of the C++ program, you need to convert as necessary.
So I might have to convert to binary. Have any way of doing it in C++?

MORE..
The way it is at the moment, I hope to store the HEX output from the ADC in RAM or a data logger(if I can find any appropriate one), then at the end of data capture, transmit (upload) to a PC (file) via UART.
It is at this stage that I want to write a C++ algorithm to sort, compare, manipulate, etc before doing a graph..

>1) I do not know how to start/initiate my data upload to the PC
First you need to have a clear idea of what 'upload' means to you. Are you gathering the data on another system and transferring it through a network to the PC? Are you reading from a file, from a process, from a socket? Upload to what? A file? A memory map? A pipe?

>(2) I do not know how to manage the HEX data once it gets to the PC.
If it's in text format then depending on the needs of the C++ program, you need to convert as necessary.

>(3) Do I need to convert data to Decimal before I can run algorithms on it?
If the data is in text format as you said, you need to convert it to binary so that it can be treated as numeric values rather than character values. Once in binary format, decimal and hexadecimal are nothing more than representation differences, and internally are identical.

Thanks for your earlier comments. Answers to some of your queries are as follows:
The way my design is at the moment, my inputs are mVolts data going into the ADC at a regular interval. I hope to store the HEX outputs from the ADC into RAM or a data logger (if I can find any appropriate one), then at the end of data capture, transmit (upload) the data to a PC (file system) via UART.
At the end of this stage, I’ll want to write a C++ algorithm to sort, compare, manipulate, etc before doing a graph of the original data.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.