Without knowing much about the
application, here are some things that you would
want to look at. From your description, it looks
like you are building a software interface to communicate
with and acquire digitized data from some source.
Here are some things that I would look to do
before you start writing code:
1. Write down
all the functions you need the software to perform.
Once you identify the functions, does there have
to be a sequence for these functions, or are they
user (or event) driven.
2. Is there a control
signal that is used to start/stop acquisition. If
so, where does that signal originate - is it a user
input or is it from another piece of hardware. If
it is hardware, does your code have to control that
piece as well.
3. Identify the outputs you
need to display. And the source of these outputs.
What is the type of display you need for each data
Create a flow chart and identify as
many pieces of the process as you can. Identify
the relationships between different sections if
any. That should get you started. Once you have
that figured out, then you can look at implementing
each block of the flowchart probably as modules
and tie them all together, reusing as many blocks
as you can.
To answer your question on the
header, in a lot (most) of cases, the header section
of the data packet consists of information that
is needed to parse the rest of the packet. Headers
can contain start bits (or characters/sequences
of characters) to identify start of a packet, number
of bytes being transferred, timestamps, etc. There
is no fixed definition for headers, unless your
packet structure conforms to a particular protocol.
If you are defining your own packet structure, the
header is up to you.