Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Statistics ExpressVi wrong time

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

0 Kudos
Message 1 of 5
(2,696 Views)

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.

0 Kudos
Message 2 of 5
(2,687 Views)

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

 

0 Kudos
Message 3 of 5
(2,674 Views)

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.

0 Kudos
Message 4 of 5
(2,665 Views)

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 :smileywink:

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.

 

 

0 Kudos
Message 5 of 5
(2,647 Views)