LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Allan variance program

I cannot run or debug pictures.

0 Kudos
Message 11 of 16
(999 Views)

Sorry, the sub vi is attached bellow. 

0 Kudos
Message 12 of 16
(982 Views)

Your subVI is just a mess. All it generates is a 2D complex array with a single column and only a RE part. There is no need for 2D complex. Also, the X axis would need to be calculated only once, of course. I am sure it could be done in plain LabVIEW with a stack of two small FOR loops. No need for mathscript.

 

In a nutshell, here's how you would generate your xy graph data. Of course your subVI could just return the 1D DBL array instead (Or even the pink cluster). 

 

Avar.png

 

 

0 Kudos
Message 13 of 16
(965 Views)

Thank you so much for your kind guidance. 

I cleared all the things as mentioned. 

Now one problem is that for small data it is fine but for large data it takes long time to compute. Is this the problem of math script? 

I have tried in plain LabVIEW but i am stucked there in the end for which i came to math script and not working. I have translated the matlab code to plain Labview code.

Can you please review the vi's please. 

I have attached the vi's. Hope will get kind response.

 

Thank you.

 

0 Kudos
Message 14 of 16
(940 Views)

You are making horrible performance choices. For example, why would you read a large array via local variables in a tight inner loop instead of just using a wire? The compiler needs to assume that the array can change at any time and thus needs to re-read it from scratch with every iteration. If you use a wire, LabVIEW can constant fold the array for the duration of the loops.

 

WhyOWhy.png

On a side note, index array is resizeable, no need for two instances. You should also mind representations and not mix orange and blue wires. Don't wire N if you are autoindexing.

 

In fact all your local variables should be eliminated. Once you exclusively use wires, the execution order is determined by dataflow and you can also eliminate the sequence structure. And yes, plain g-code is faster than mathscript and once you get rid of it, It is also much faster to load the program into memory.

0 Kudos
Message 15 of 16
(915 Views)

Hi. Thank you.

Still i am facing problem in execution. In translation of matlab code to plain labview, in last i am facing problem.

matlab code:

sigma2 = sigma2./repmat((2*T.^2.*(N-2*m)),1,M);

sigma = sqrt(sigma2) ;

i used mathcript for this but not working and i stucked here to convert it to labview code.

the rest code is translated as in previous vi i shared.

i removed the local variables but once this last part is cleared then the code will be executed.

It gives the following error while execution.

error.PNGThe vi is also attached.

 Thank you.

 

0 Kudos
Message 16 of 16
(891 Views)