LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

PlotStripChart can draw seperately? please help.

Hi :
Can the PlotStripChart draw the data points acquired by DAQmxReadAnalogF64 ? and how to?
Here is part of my code
////////////////////////////////////////////////////////////////////////////////////////////
DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai0","",DAQmx_Val_Diff,min,max,DAQmx_Val_Volts,NULL));//0
DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai1","",DAQmx_Val_Diff,min,max,DAQmx_Val_Volts,NULL));//1
DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai2","",DAQmx_Val_Diff,min,max,DAQmx_Val_Volts,NULL));//2
DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai3","",DAQmx_Val_Diff,min,max,DAQmx_Val_Volts,NULL));//3
DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai4","",DAQmx_Val_Diff,min,max,DAQmx_Val_Volts,NULL));//4
DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai5","",DAQmx_Val_Diff,min,max,DAQmx_Val_Volts,NULL));//5
DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai6","",DAQmx_Val_Diff,min,max,DAQmx_Val_Volts,NULL));//6
DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai7","",DAQmx_Val_Diff,min,max,DAQmx_Val_Volts,NULL));//7
DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,"",rate,DAQmx_Val_Rising,DAQmx_Val_ContSamps,sampsPerChan));
DAQmxErrChk (DAQmxGetTaskAttribute(taskHandle,DAQmx_Task_NumChans,&numChannels));
DAQmxErrChk (DAQmxReadAnalogF64(taskHandle,sampsPerChan,10.0,DAQmx_Val_GroupByScanNumber,data,sampsPerChan*numChannels,&numRead,NULL));

if( numRead>0 )


ArrayToFile (file_name, data, VAL_DOUBLE, numRead*numChannels, 512,
VAL_GROUPS_TOGETHER, VAL_GROUPS_AS_COLUMNS,
VAL_CONST_WIDTH, 10, VAL_ASCII, VAL_APPEND);
PlotStripChart(daqmxpnl, DAQMXPNL_MXSTRIPCHART,data,numRead*numChannels,0,0,VAL_DOUBLE);
ProcessSystemEvents();
///////////////////////////////////////////////////////////////////////////////////////////////////////////

Question here:
1.
Above, the PlotStripChart function plot the datapoints acquired in one single Stripchart control simutaneously with different colors.
Now I want to plot 8 different channel's data in 8 seperate Stripchart controls,every channel in every Stripchart
how can I do?
2.
I use ArrayToFile to save the datapoints acquired by the card ,and the datapoints are 8 channels together
If I want to Load the datapoints and Plot them in 8 seperate StripChart controls ,just like they are being acquried
except first use the FileToArray .how can I do?
Thanks a lot

/////////////////////
Windows xp sp2 /
Labwindows/cvi 7.1 /
NI PCI-6014 /
NI DAQ7.4 /
/////////////////////
0 Kudos
Message 1 of 3
(3,396 Views)
How the strip chart interpret the array received in input depends on the number of traces preset in the control: you should have the strip chart set to show 8 different traces.

In case you want to whow only a trace, you must set the number of traces to 1 (either in the UIR editor or with SetCtrlAttribute (daqmxpnl, DAQMXPNL_MXSTRIPCHART, ATTR_NUM_TRACES, 1)) and then plot the array: only the first data set will be plotted, corresponding to the first channel (you may need to use Skip count=8 in case your data are interleaved).

To plot the following data sets, you can use Starting index parameter in PlotStripChart: to plot the n-th data set you can pass n as starting index if data are interleaved (with 7 as skip count) or (n-1)*numRead if data are grouped per channel (with skip count = 0).


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 3
(3,391 Views)
Roberto Bozzolo
^_^,Thank you very much!
I'll do it right now ,really appreciate your help.^_^
0 Kudos
Message 3 of 3
(3,387 Views)