How to send multiple values in string through serial port

Hello everyone, im having a small problem of how to send multiple values stored in variables via string.
“02 00 V_MSB V_LSB C_MSB C_LSB 03” this is the value which i want to send thorugh serial port in the string format.
Also the V_MSB V_LSB C_MSB and C_LSB have some values in it too. is it possible to send those values in string?

#include <Wire.h>
#include <MCP342X.h>

MCP342X myADC;
const int outpin=A0;
static int16_t result;

const String tset1=‘02 00 V_MSB V_LSB C_MSB C_LSB 03’;// have to send this value in format of string

const byte NUM_COMMANDS = 4;
const byte COMMAND_SIZE = 4;
char incomingdata[NUM_COMMANDS];

// array with all incoming commands
const char commands[COMMAND_SIZE] = {

// commands to send
int T=V_MSB;
const char *sendStr[NUM_COMMANDS] = {“tset1”, “tset2”, “test3”, “tset4”};

void setup()
while (!Serial)
Serial.println(“Starting up”);
Serial.println(“Testing device connection…”);
Serial.println(myADC.testConnection() ? “MCP342X connection successful” : “MCP342X connection failed”);
myADC.configure( MCP342X_MODE_CONTINUOUS |
Serial.println(myADC.getConfigRegShdw(), HEX);

void loop()
// read it

boolean foundCommand = false; // true => got valid command

// while more commands
for(int cmdIdx=0; !foundCommand && cmdIdx < NUM_COMMANDS; cmdIdx++)
// compare incoming to valid command
int idx=0;
for( ; idx < COMMAND_SIZE; idx++)
if( commands[cmdIdx][idx] != incomingdata[idx] )

// if we got a match
if( idx == COMMAND_SIZE )
// send appropriate character

// signal done
foundCommand = true;

} // if

} // for

} // if

Thank you in advance.

You have not told us what the data is being sent to?

Have a look at the examples in Serial Input Basics - simple reliable ways to receive data. There is also a parse example to illustrate how to extract numbers from the received text.

The technique in the 3rd example will be the most reliable. It is what I use for Arduino to Arduino and Arduino to PC communication.

You can send data in a compatible format with code like this (or the equivalent in any other programming language)

Serial.print('<'); // start marker
Serial.print(','); // comma separator
Serial.println('>'); // end marker

There is no need to create a single cstring before sending the data. As far as the receiving device is concerned these two versions will appear identical

Serial.println("Hello world");
Serial.print("Hello ");


Im receiving data from docklight in the form of at commands (STX 01 ETX) and in the reply im sending a string of data (02 00 30 12 32 03).
so there is a way if i can send all these commands in the form of string.
there are 3 more at commands .

Im receiving data from docklight ....

What is "docklight"?

Have you carefully studied the examples in the link I gave you in Reply #1? I suspect not, as you replied about half an hour after I posted Reply #1.