Send the ADC data to pc in the form of packet...

I'm trying to send the ADC data to pc in the form of packet in Arduino due.

Example : Create a packet, that packet contain 6 channels data and 1 start byte ,1 stop byte. Totally the size of the packet is 8 byte.

how to create a packet ?...

byte packet[8];

packet[0] = 0xFF; //header
packet[7] = 0x0D; //stop

Then fill packet [1] to packet [6] and send?

for(int ii = 0; ii < 6; ii++)
{
packet[ii+1] = channel[ii];
}
udp.write(packet, 8);

Something like this? please post the code you have now…

iyappan:
how to create a packet ?...

What type of a "packet" do you mean?
Serial? TCP? UDP? UPS?

jurs:
UPS?

Took me a while() before I got it...

Actually i read the data in C++ ( Serial.cpp, Serialclass.h )
(http://playground.arduino.cc/Interfacing/CPPWindows), My code is

void setup
{
Serial.begin(9600);
adc_init();
adc_interrupt_enable(0x 81);
write_protect_mode(true);
adc_start();
}
void loop
{

 while( check_DRDY()==1)

{
 
packet[0] = 0xFF; 
packet[7] = 0x0D; 
for(int i = 0; i  < 6; i++)
{
packet[i+1] = channel[i];
}
Serial.write(packet,8);

}

nothing its showing in command prompt…

Actually i read the data in C++ ( Serial.cpp, Serialclass.h )
(http://playground.arduino.cc/Interfacing/CPPWindows), My code is
...
nothing its showing in command prompt

Posting Arduino code that could actually compile would be useful.
Posting the C++ code that thinks it can read the Arduino data would be useful.

A "command prompt" is something like:
Hey, you, enter a value >

Why you would be using data from the Arduino to formulate the prompt escapes me.

iyappan:
while( check_DRDY()==1)

What the hell is this 'check_DRDY()' function call doing?

Most likely it doesn't return 1.

And because this function 'check_DRDY()' that you don't show as a source code does not return 1, your loop function doesn't do anything at all.

The source code is my own code , My system is remote desktop connection so i can’t sent the code. Adc program is already avilable in arduino . So please using that code…

Give any idea about the Serial packet… any example…

The source code is my own code , My system is remote desktop connection so i can’t sent the code. Adc program is already avilable in arduino . So please using that code…

Give any idea about the Serial packet… any example…

I have a problem. My code doesn’t work. I can’t (or won’t) show you the code on the PC, but I’ll show you some crap that might bear a passing resemblance to my Arduino code. I still need help.

Have I paraphrased your post so far correctly?

iyappan:
The source code is my own code , My system is remote desktop connection so i can't sent the code. Adc program is already avilable in arduino . So please using that code...................

Give any idea about the Serial packet.... any example...

adc is not in my arduino IDE...
and try replacing:

packet[i+1] = channel[i];

the channel with your own analog input.
Discard the while() loop, does it work then?
And I do have to agree with PaulS, If you can't post your code, we can't help you...