12-16-2005 04:21 AM
12-16-2005 04:53 AM - edited 12-16-2005 04:53 AM
Hi Drepen, if you can detail a little more how your application manages acquisition we will be able to help you more precisely. Anyway, normally an acquire-demux-and-disply application can be structured as follows:
1. Define your acquisition task and execute acquisition: it will return an array on measures in per-sample order (sample1channel1, sample1channel2 ... sample1channelN; sample2channel1, sample2channel2 ... sample2channelN ... sampleMchannel1, sampleMchannel2 ... sampleMchannelN)
2. Use Scan_Demux to organize your array in per-channel order (sample1channe1, sample2channel2 ... sampleMchannel1; ... sample1channelN ... sampleMchannelN)
3. Divide the array into sub-arrays per channel. I have found very useful in this respect ConvertArrayType function, which permits me also to change initial type of the array to final type (acquisition function return raw data in a short array so I need to convert to engineering measures after acquisition completion: copying channel measures into a double array I can apply to this the proper conversion coefficients)
I hope this informations can help you to solve your doubts, otherwise add some details to let we help you more precisely
Roberto
Message Edited by Roberto Bozzolo on 12-16-2005 11:57 AM
12-16-2005 05:36 AM
12-16-2005 07:43 AM
12-16-2005 08:18 AM
Unfortunately I am actually using traditional daq driver, so I cannot help you in this respect. Anyway, parameter DAQmx_Val_GroupByScanNumber let me assume there is another option that returns an array grouped per channel. This will make difficult to plot measures on the strip chart but will ease splitting the array.
In any case, if you cannot locate a replacement of SCAN_Demux inside daqmx driver you can manually reorganize the array with a loop like this one:
for (i = 0; i < sampsPerChanRead; i++) {
for (j = 0; j < numChannels; j++) {
newFile[i + (j * sampsPerChanRead)] = data[i * numChannels + j];
}
}
(Please debug it carefully: since I have no need to use it this is only an attempt...)
12-16-2005 07:18 PM