LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Building an Array

So I am making SOME progress.....I created the equation I need to graph and generated the "x" based on the itteration

The values for Y are coming out correct, but I am not seeing any plot on the waveform.

 

Suggestions on what I am not doing correctly?

 

snip2.png

 

wave.png

Download All
0 Kudos
Message 11 of 25
(993 Views)

Right click on the graph axis values and set them to Autoscale.  I suspect the plots are just outside of the visible plot area.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 12 of 25
(990 Views)

Looks like all is set to autoscale

 

xaxis.png

0 Kudos
Message 13 of 25
(988 Views)

UPDATE: I wrote the data being fed to the graph to a spreadsheet and it is only generating a single value for Y of 8.938.

So I am not generating the 2000 values like I thought?

There is something I am not understanding about the for loop

0 Kudos
Message 14 of 25
(985 Views)

Ahhh, you have AutoIndexing turned on for your coefficients and a value wired to the For Loop count terminal.  You cannot have both.  Well, technically you can have both, but the count terminal is ignored in that situation.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 15 of 25
(983 Views)

Suggestions on how to fix this? I tried disabling the autoindex and moved the graph inside the loop....but same results....no plot.

0 Kudos
Message 16 of 25
(984 Views)

No, it's not ignored, since the for- loop determines the minimum value of all indexing inputs and the loop-count terminal. If the number of array- elements are greater than the constant wired to the loop count terminal, this will be the limiting number.

You have to decimate the dimension of your polynomial coeficients with a "index array" function, then there is no autoindexing and the loop will execute 2000 times.

Btw. why are the coefficients coming from an array?

Greets, Dave
0 Kudos
Message 17 of 25
(982 Views)

I'm not sure I follow what you are suggesting. Can you elaborate?

 

The poly coefficients are coming from an expresse VI curve fitting filter. One of the outputs from that VI is an array containing the coefficients of the second order polynomial curve.

 

Thanks 🙂

0 Kudos
Message 18 of 25
(976 Views)

OK, I think I got what you were saying....I tried this and it seems to be working WHEW 🙂

Thanks

 

poly.png

0 Kudos
Message 19 of 25
(973 Views)

The problem is you are using array subset with a length of 1.  That gives you an array with exactly 1 element.  When you auto-indexed on that, you got one iteration of the For Loop even though you had 2000 wired into N.  (For loops run the amount of times that is the minimum between the N terminal and the shortest auto-indexed array.)

 

What you show now isn't much better.  You are still only getting 1 element and using index array to get that down to a scalar.  What you should have done is just used index array on the original 1-D array of polynomial coefficients  When you expand Index Array down, you'll get elements 0, 1, 2, .... automatically.

 

An alternative is to use Polynomial Evaluation in the Mathematics >> Polynomial palette.

0 Kudos
Message 20 of 25
(970 Views)