11-09-2012 03:55 AM
Hello,
I need to link my start and end time to data in my array, so bassicly my qeustion is how can I link my start / end time to an index in my array?
Regards
11-09-2012 04:41 AM
Repeating your question wont help it explain better. If you post some code or atleast provide a bit more information, people will be able to help.
Right now, I am finding it difficult to understand what you are really after.
11-09-2012 05:18 AM
Hehe yea I agree it was pretty vague. But there is no easy way to explain this, point is my results are resambling an parabolic function. Problem with this is that i have 2 minimum value's so i cannot use Array-subset to get the min value, cause it's not reliable wich minimum it will take. Thats why im using the time in my program, so I made a case structure that i could obtain the start and end time of the measurement. Now what i want to do is, link the start time to the first minimum, and the 2nd time to my last minimum. When I know the indexes of the array that are linked to these times, i can get the right value's out of my array so I can calibrate the right results. Check attachments for clarification, let me know if there is more clarification needed.
Regards.
11-09-2012 05:35 AM
11-09-2012 06:40 AM
This works but it still leaves me with a big problem, the two minimums dont have the same value's. When i use this method sometimes minimum 2 will be displayed as minimum 1. This will end up as an NaN in my calculations. Thats why i wanted to lock the index values by using time, cause I have the time from minimum 1 and and miminum 2. In other words, i cannot be sure when i use this method that minimum 1 is really minimum 1 it can also be minimum 2 and minimum 2 could be minimum 1. This will give problems when i want to use the index values out of the array's to calculate with.
11-09-2012 07:00 AM
You should convert your data array into a waveform. In the waveform palette, you can then use the "Waveform Peak Detection.vi" for your search. It is in the palette:
Programming>>Waveform>>Analog Wfm>>Measurements>>Wfm Monitoring.
This function is available in either Full or Professional Development System.
hope this helps,
Norbert
11-09-2012 09:15 AM
Hmm no this still doesnt fix the problem. It only gives me the times when the minimums occur, but i already had those value's. Someway I need to get the index numbers of the occuring times. I really cannot figure this out..
11-09-2012 09:20 AM
The waveform contains a starttime (T0) for the data set (Y) and a "Delta t" which refers to the sample rate (1/fs), because it is the time which elapses between the samples the hardware acquires. If you have a sampleclock driven acquisition device, this Delta-t is a constant value (1/fs). If you acquire data per softwaretiming, you don't have a constant Delta-t and therefore, your request is nearly unsolvable (or each sample has to bind its unique timestamp to it when it was acquired).
So the "start time" and "stop time" you are asking for is T0+n*"Delta-t", where "n" is the index of the first/second minimum. You have to make sure that the indexes of the minima are sorted correctly, otherwise your "elapsed time between the minima" would be negative....
Norbert
11-12-2012 04:40 AM
Thanks for replying on my answer Norbert, you are correct. I already extracted the t0 and dt from my signal, but its exactly like you said if you dont have the value's of the indexes sorted correctly my result will end up negative. And i guess this is my problem atm, i used the method that was shown earlier in this topic to obtain the 2 index value's of the 2 minima's tho with this method it doesn't seem to always work correctly. Is there a other way to get these indexes sorted correctly ? Cause now 50% of the time my results show up as NaN.
Regards.
11-13-2012 09:29 AM
So it seems that you don't only require start and stop time, but also the elapsed time in between.
DId you try to take the absolute value of the difference between both timestamps?
Norbert