ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

using 3D Surface with x,y,z variables (earn money)

Hello,
before some weeks i ask the same question and after that i become some good questions, but i can't find a answer for my problem. Maybe now i describe it more and i attached my Programm, where you can see my problem.
At first, i use Labview 5.1 and i can't open Labview 6.x VI's, so please if you attach a programm so save it as LV5.1 thank you.
My ActiveX funktions very good and i don't have problems with it, bevause i use in the programm (SUBCI EXCEL) to read some numbers from a Excel File who works with ActiveX.
In the Programm you can see the variables "Helligkeit" ->x, "Luftfeuchtigkeit"->y and "Stellwert"->z
If x or y changes, i have another value for z, and i will show it in the 3d graph li
ke the screenshot waver.jpg i attached.
The problem is, when i change x and y or keep it constant, it doesn't matter i can't see any draw in the 3D Surface.
Do i need 3D Parametric Chart or 3D Curve Graph.
The result is important, so if you have a idea so please attach a picture or change the VI and save it as LV5.1.
There are some SubVI's but if you understand my problem, then you don't need this SUBVI's. You can also make a new LV5.1 VI only to show me how this 3d Curve Graph or 3D Surface works.

So you can't imagine how much i thank you if you help me.
Thanks for your answer in advance!It's very important please help me!Maybe you can earn some money if you help me more, info per email(NO JOKE)!
Greetings,
Ender Ekinci
P.S.: You can send me a Email if you have agood idea or do you know to solve this problem
ender.ekinci@epost.de
Download All
0 Kudos
Message 1 of 12
(4,546 Views)
To quote from the online help:
If the number of elements in x vector does not match the width of z matrix in the first dimension and the number of elements in y vector does not match the width of z matrix in the second dimension, both x vector and y vector are ignored.

Your VI creates an 1D array of 2 values for the x vector and a 1D array of 2 values for the y vector. But the value of Stellwert is duplicated into a 2D array which is 2x1. That causes both x vector and y vector to be ignored.
Michael Munroe, CLD, CTD, MCP
Automate 1M+ VI Search, Sort and Edit operations with Property Inspector 5.1, now with a new Interactive Window Manager!
Now supports full project automation using one-click custom macros or CLI.
Message 2 of 12
(4,546 Views)
Hello Michael,
thanks for the answer but i know only this way to convert the 1D array into a 2D array for Stellwert (z).Otherwise it's not correct and i can't run the programm.
How many posibility's i have to show Stellwert(z) as 1Darray , Please look at the Screenshot, that what i mean.
Maybe you can help me ?

Thanks for your answer in advance.

Greetings,
Ender Ekinci
0 Kudos
Message 3 of 12
(4,547 Views)
from the help
"x vector is a 1D array that describes the surface from z matrix in relation to the x plane.

The y vector is a 1D array that describes the surface from the z matrix in relation to the y plane.

z matrix is a 2D array of data that describes the surface. The x and y vectors shift or skew the set of data in the z matrix."
So i don't see any other way for the Z. i must convert the 1d array into a 2d array and wire it, otherwise it doesn't function.

Please help me i need it for the exam. in 2 days i must be solve this problem.

Thanks for your answer in advance.
0 Kudos
Message 4 of 12
(4,547 Views)
Try to break up your program into stages so you can work on them each seperately. First show that the portion of your program which is supposed to produce an x-vector, a y-vector. Break it down into smaller pieces...

If you an example of what the 2D array should be compared to what you are getting, it should be easier to help you.

I couldn't tell what you were trying to accomplish without the sub-VI's. Try save as "development distribution" if LabVIEW 5.1 supports that.
0 Kudos
Message 5 of 12
(4,547 Views)
I think i have an idea if why your graph isn't working. Forgive me if i am wrong but it looks like you are sending individual points to the graph and plotting each one separately without keeping the past points and plotting them together.

Either you should acquire all your data, then plot the graph at the end, or add new data points to the past data points in an array using a shift register. Then plot the graph from the shift register.

If you would like an example then let me know and i'll try and put something together for you..

Kim
0 Kudos
Message 6 of 12
(4,547 Views)
Hello Isaak,

it's very true what you say. I try to save it as development distribution and it functions.
I attached the file and i hope you know, what i will do.
I will only show the x and y variable with the Zvariable, which i must convert to a 2d array, otherwise i become a error.
Please help me if you know any possibility to draw the 3D Surface.

Thanks for your answer.
Greetings,
Ender
0 Kudos
Message 7 of 12
(4,547 Views)
Hello Kim,
Thank you for your answer Kim. I think you are right regarding the way I plot points. And your answer seems is very helpful. But still I have difficulties implementing it.I would be grateful if you could send me an example as you proposed in your answer.Maybe you could alter my programm, which i have attached in my last answer as development version (ca530kb)in LabVIEW5.1!
I attached a screenshot , how it seems when my programm is right.
I thank you in advance
greetings
Ender
0 Kudos
Message 8 of 12
(4,188 Views)
Hiya again

Now, i have changed your program, but i dont know if it is what you want. I've put your code into a For loop (to run 6 times - 6 data points), and collected all the data together at the end into an array and plotted it on a new graph (the one above yours). When you run the VI change the knobs to change the data so you will see the plot.

I'm sure it's not what you want, but at least it shows you how to plot a graph and acquire data in your program. The main thing you must understand is that to plot a surface graph you need more than one set of x, y and z coordinates - infact you need at least 3 different sets, otherwise all you will get is a point (1 set) or a line (2 sets).

I think you first need to think about the
data you are actually producing, and examine the array to see what you are plotting - maybe even draw the plot manually from this data. I think then you will understand a little more what is happening, and what you need to do.

I hope this makes it a little clearer for you..

Kim
0 Kudos
Message 9 of 12
(4,188 Views)
Ender,

I couldn't save to LabVIEW 5.1 for you (I would only be able to go back as far as 6.0) but I can give you the documentation showing one way to accomplish the goal of a 3d graph showing data.

It sets up x-vectors and y-vectors based on computing the correct z-value for an entire 2-D grid of x-y coordinates, selectable by choosing min x, max x and the number of steps in x (resolution in x) and the same for the y-axis. You can then use your dial controls for x and y to read off exact individual Z-values which can be hard to read exactly just by looking at the 3D graph control alone.

I also showed a couple ways to make some of your other code a little more compact. There may have been some advantage for
future plans for the way you did it, but I think my examples produce the same result with less wiring.

Also, I could not use the portion where you download a value from Excel because I didn't have your Excel data, so I temporarily placed a FAKE function in its place.

Cheers!
0 Kudos
Message 10 of 12
(4,547 Views)