From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Dynamic Signal Acquisition

cancel
Showing results for 
Search instead for 
Did you mean: 

How to add corresponding elements from two arrays in a continuous acqusition?

Solved!
Go to solution

Dear all,

 

I am writing a program (in labview  version 9.0) to acquire signal from a fast photomultiplier. I am using the acqusition rate of 1.25 Ms with an external trigger. Now what i need is to add the data from 'n' such acqisitions and then process further.  For example if I am acqiring the signal for 200µs then total number of data points with the the acqusition rate of 1.25Ms will be 250. I will get a 1D array of 250 data points each time I run my acquisition.

 

Lets say                     Array 1from acquisition number 1,            0.1, 0.3, 0.5, 0.6 , ...........  up to a total 250 data points 

                                 Array 2 from acquisition number 2,            0.4, 0.5, 0.8, 0.4,  ............ up to a total 250 data points 

                                                                                             ----------------------------------------------------------------------------------

                                                Added array should be,             0.5, 0.8, 1.3, 1.0, ...............up to a total 250 data points

                                                                                             -----------------------------------------------------------------------------------

 

To do this I need to first save the array from acqisition number 1,  then run the acquistion no. 2 and add the corresponding data points to the saved array. This should be continued to a user defined nuber of acqusition say 10, 20 or 50.... I don't know how to do it. Can any one help me out in this problem?.

 

Thank you very much in advance

 

With best regards

Chaithanya

 

0 Kudos
Message 1 of 5
(7,307 Views)

Dear All,

I have succeded in writing the program to do what I have mentioned in my above post. However I have a new problem now, the program slows down when I run it for long. This program has been written to run a cavity ring-down spectrometer. The signal I am acquiring has an exponential decay and I need to get the life time of the signal by fitting it after the acquisition. What I do is I will set the number of acquisitions to average and then I take the averaged data to fit with an exponential fit. Before going for the exponential fit I do a rough guess with first 15 data points to have an idea about the total fit length. This works fine but the program slows down after few seconds of run. I suppose the probelm is in handling the huge data set. I have a PCI-6251 acqusition card with the sampling rate 1.25Ms/s. can some one has a smarter way to do the same?. I have attached my code with this post.

 

Any suggestions are greatly appreciated.

 

Thanks in advance.

 

Chaithanya

0 Kudos
Message 2 of 5
(7,284 Views)
Solution
Accepted by topic author c.jain

 

I asume that avarages and acquisition time will not change during a measurement, so keep that outside the the loops. If you know your parameters for the fit make them constants.

one create task (outside the loops) and one close task at the end.

 

Avoid the build array where possible. With no. av. and no. of acq.points declaired, the size of the arrays is fixed and you can (re)use one array and the replace array elements.

 

 

No need to collect all data and avarage them after collecting. just add

 

I add a suggestion 😉

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 3 of 5
(7,270 Views)

and backsaved for 2009

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 4 of 5
(7,269 Views)

Dear Henrik,

 

Thank you very much. You help is really appreciated. I am very new to labview and hence not very efficient in programming. I am learning by mistakes any way. That was really helpful.

 

Thanks again

 

Chaithanya

 

0 Kudos
Message 5 of 5
(7,259 Views)