04-21-2005 06:35 AM
04-21-2005 07:48 AM
07-07-2005 08:01 AM
Dear DF Gray,
It would be very nice if you could give me again some of your professional help and advice regarding a modification in the multiple-recordVI I am currently using for the multiple-recording of my waveforms (please see attached example “Multi_record from Beam_3”).
My situation is the same as described in our conversation on 04/21/2005 (please see conversation above).
A short reminder: Per loop-iteration, I am fetching ONE of the multiple-recorded waveforms (using the niScope Fetch WDT.vi inside the for-loop to avoid buffer problems), feed the waveform through the fitting-routine and save the fitting value in a 1D-array. This is done until all multiple-recorded waveforms are processed. At the same time, I acquire for each waveform fitting value the CORRESPONDING voltage average value from the power meter (acquired from CH1). So in the end, I will have a 1D-array with my waveform fitting values (CH0) and a CORRESPONDING 1D-array with the voltage average values (CH1).
Situation: Instead of passing the fetched waveforms on-by-one through the fitting-routine, I would like to average first a consecutive number of fetched waveforms and then pass only the average waveform through the fitting-routine. For example: The first 8 waveforms (wfm’s 0-7) from the 128 multiple-recorded waveforms are fetched one-by-one and the average waveform is created. After that, the average waveform is passed through the fitting-routine and the fitting value is saved in the 1D-array. Now the next 8 waveforms (wfm’s 8-15) are fetched and averaged. The average waveform is again passed through the fitting-routine……. this repeats itself until all 128 multiple-recorded waveforms are processed (16 fitting values in the 1D-array). In parallel the CORRESPONDING voltage average values from the power meter (acquired from CH1) are treated in the same way.
The goal of this exercise is to reduce the time which is needed by the fitting-routine to process the multiple-recorded waveforms.
I still would like to fetch only ONE of the multiple-recorded waveforms per loop-iteration, using the niScope Fetch WDT.vi inside the for-loop structure to avoid buffer problems.
It would be very nice if you could give me some help with this issue. How should I do this? What is the most efficient way to handle the waveforms and average the waveforms / voltage average values?
Kind regards,
Beam
07-08-2005 08:16 AM
07-11-2005 05:09 AM
Dear DFGray,
Thank you very much for your reply and helpful comments. I wrote two versions of the LabVIEW program (please see attached library “Multi_record from Beam_4”). The program “Multi_record_dual channe9.vi” is using my way to determine the record number to fetch. The second program “Multi_record_dual channe9a.vi” is using your proposed method to determine the record number to fetch (I hope I understood your way correctly).
Problem:
After I average e.g. 5 waveforms in the inner For-loop (using the shift register to add the 1D arrays and then divide the final 1D array by factor of 5), I do not get my 1D array of the averaged waveform out (which has to be passed to the waveform fitting routine). There are only zero’s in the array which is passed to the waveform fitting routine. What is my mistake?
It would be very nice if you could have a look at the programs to check if I made any more mistakes.
Which is the better way to determine the record number to fetch?
I certainly will have questions about the resampling of waveforms to avoid the smearing, but first I need to check if this “simple method” is acceptable in my main program. Is there another way than resampling to average the waveforms (For example using a certain value in the waveform 1D array as reference position, then aligning the waveforms 1D arrays to each other and average them in a last step)?
Kind regards, and thank you very much for your help!
Beam
07-11-2005 08:45 PM
Ooops, I think that I forgot to initialize a 1D array for the shift register. Please see attached program "Multi_record from Beam_5". Is this the way to solve this problem?
Kind regards,
Beam
p.s. Is it better to do the averaging of waveforms by using the 1D-arrays of the waveforms or the waveform data type directly as you suggested earlier?
07-18-2005 08:21 AM
07-19-2005 06:00 AM
Dear DFGray
Thank you very much for your reply. Your comments are always very helpful!
I included the changes you suggested in my program i.e. array initialization outside main loop and fetching 1D arrays instead of wfm’s (please see attached program “Multi_record from Beam_6”). I hope that I made no mistakes.
It seems that I can save ~1 second per processed data point in my main program when I fetch 1D arrays instead of wfm’s.
Some additional questions:
1. To confirm my own understanding: Is it correct that in the way I am “Initiate Acquisition” and “Fetch no. of records” in my program, the fetching of the waveforms/1D-array starts as soon as waveforms/1D-arrays are available from the Initiate Acquisition process (fetching while acquiring waveforms)?
2. Is there any way to increase the fetch speed so the waveforms/1D-arrays are quicker available for the adding and curve-fitting process? The main goal is to increase the processing speed without changing my curve-fitting routine.
3. Resampling of waveforms to avoid smearing:
a) In your reply from 07/08/2005 you wrote: ”Use the reference position information to generate the values needed for the resample” What do you mean by this?
b) Where would I place the “Resample Waveforms (single shot).vi” in my program to resample in the most efficient way?
c) Could I also do the resampling using 1D-arrays instead of waveforms?
Thank you very much for all your help & comments
Kind regards,
Beam
07-19-2005 08:49 AM
Your changes look good. There is one minor issue that may cause you problems. The array size should be numSamples, not min record length. This will keep the arrays the same size.
Since you are not using the Channel 1 waveform, you may be able to save some time by either eliminating it or moving it outside the loop to only fetch the last waveform for display. I believe the measurement will work without fetching the waveform (although the driver will actually fetch the waveform to take the measurement, it will not get copied into the LabVIEW memory space, saving time and memory). I could be wrong, though. It has been awhile since I worked with NI-SCOPE measurements.
07-20-2005 06:05 AM