09-01-2009 05:00 AM
Hi, maybe you could help me.
Im trying to get the time difference between two maximums of a signal. Im using Express VI Statistics for it.
The problem is, if i display the "time of Maximum", its not in seconds or msec.
If i change loop-wait-time, the displayed time changes too.
Is it possible to display the correct time in sec?
mfg, andi
09-01-2009 09:25 AM
Not sure why you posted this to the Multifunction DAQ board.
The time of maximum is in fact in seconds and is displaying the correct time. Create a graph output for the sine wave you are generating and right click on it and deselect Ignore Time Stamp. You will see that the times reported by the Statistics function correspond to the times on the x axis.
09-02-2009 01:10 AM
In my main program im using a DAQmx read Vi for an incoming sinus wave.
Problem is, im using a statistics vi and a table to process the incoming data (speak Maximum and time of maximum).
And similar to my sample VI here, the time of maximum is not displayed correctly in my table.
Seems to work with Wait Until Next ms Multiple with 100ms.
Question is, why isnt it working with any wait time?
My real Vi looks like this, but is a subvi
09-02-2009 09:29 AM
The statistics function in your first VI is returning correct times.
Your second VI is completely different and does not seem to have anything to do with the statistics function. Your use of local variables in that one is wrong. Your indicators wired to the locals will exhibit a classic race condition. They will get updated long before you write to the locals.
09-04-2009 02:23 AM
Sorry, youre right , i posted the wrong subvi. Here is the right one.
Hmm i figured this subvi out to avoid a race condition. I had some spookey issues with shift register, so i tried it this way and it worked like a charm
Do you think, a race condition could mess up my output? but why is it working?
In my first VI i dont get the real time, but some CPU rate based numbers, something like 1 displayed is around 100 ms or so.