Hi gopal_ak!
there're a lot of remarks about your SW......
First of all, I think it's not good practice to store your waves in TestScript[index_i].Value[Count], I suppose you switch from one wave to another changing index_i value..... this is not the common practice in LabWindows-NIDAQ.
First, you have to ADD CHANNELS TO YOUR TASK:
instead of
DAQmxErrChk (DAQmxCreateTask("",taskHandle));
DAQmxErrChk (DAQmxCreateAOVoltageChan(*taskHandle,"Dev1/ao0","",min,max,DAQmx_Val_Volts,NULL));
DAQmxErrChk (DAQmxCfgSampClkTiming(*taskHandle,"",rate,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000));
if( numChannels )
DAQmxErrChk (DAQmxGetTaskAttribute(*taskHandle,DAQmx_Task_NumChans,numChannels));
you place something like
DAQmxErrChk (DAQmxCreateTask("",taskHandle));
DAQmxErrChk (DAQmxCreateAOVoltageChan(*taskHandle,"Dev1/ao0","",min,max,DAQmx_Val_Volts,NULL));
DAQmxErrChk (DAQmxCreateAOVoltageChan(*taskHandle,"Dev1/ao1","",min,max,DAQmx_Val_Volts,NULL));
DAQmxErrChk (DAQmxCreateAOVoltageChan(*taskHandle,"Dev1/ao2","",min,max,DAQmx_Val_Volts,NULL)); //and so on....
DAQmxErrChk (DAQmxCfgSampClkTiming(*taskHandle,"",rate,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000));
if( numChannels )
DAQmxErrChk (DAQmxGetTaskAttribute(*taskHandle,DAQmx_Task_NumChans,numChannels));This was the first step. This is to add 2 more channels to your task. If you do it properly, you'll get 3 (or 5, it depends upon channels you put....) as
DAQmx_Task_NumChans,numChannels. This is a variable which contains the actual number of channels you have in your task.
After that, you perform a Write function this way:
Write_ContGenPerWfmIntClk(taskHandle,&data[0],bufferSize)in which data[0] contains ALL THE 5 WAVEFORM YOU WANT TO GENERATE. This is quite important, you do not have to use 5 vectors to store 5 waves!!!!!!!
You do this in the actual wave write:
DAQmxWriteAnalogF64(taskHandle, bufferSize, 0 , 10.0 , DAQmx_Val_GroupByChannel, data,&written,NULL);
Here, data will contain the 5 waves, in the same way: bufferSize is the data wave length, I mean, you can have a sinusoid of 100 points, and data will have 500 oints: from 0 to 99 you have the first wave, from 10 to 199 the second, and so on.....
This is a little bit messsy, I know, but I hope I understood your problem, and please, let me know if you reach to generate what you want.
graziano
PS.: actually, I don't work with DAQmx analogic devices, so I can't test what I'm saying..... so let me know!