From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Real Time 3D Surface/Graph

Solved!
Go to solution

I am trying to construct a 3D surface graph from incoming data from ultrasonic sensors using the myDAQ. I have currently created a randomly generated Z array with fixed X and Y values, however I am wondering how to create a more real time version of this graph by creating the inputs for the z coordinates when x is (0,0) and Y is (0,0) in increments of 1 point. I am a complete newbie to labview and even our university lecturer doesn't know how to use the software. I have uploaded the vi for the randomly generated 3d surface. 

0 Kudos
Message 1 of 4
(2,693 Views)

I cannot open the VI as I don't have a new enough version of LabVIEW installed, but you could take a look at this post which might help:

 

https://forums.ni.com/t5/LabVIEW/XYZ-Surface-plot-on-the-go/m-p/3875355#M1098383

 

I am not sure what is meant by "reating the inputs for the z coordinates when x is (0,0) and Y is (0,0) in increments of 1 point" can you give some more detail.

 

0xDEAD

 

 

Message 2 of 4
(2,686 Views)

@deceased wrote:

 

I am not sure what is meant by "reating the inputs for the z coordinates when x is (0,0) and Y is (0,0) in increments of 1 point" can you give some more detail.

 

 

 


 

Essentially my group and I are making a surface mapper and we want to record a specific Z coordinate when the sensor is in a specific place using a rocker/switch and then log each point of data to a set of X,Y coordinates so (0,0), (0,1),(0,2),(0,3)...(0,10) and then go back to (1,0),(1,1),(1,2)...(1,10) until we reach for example (10,10).

Unless there is an easier way of creating a real time surface map I'm unaware of?

 

 


 

0 Kudos
Message 3 of 4
(2,674 Views)
Solution
Accepted by topic author serialcommunication

Sorry, I only just seen this reply. Hopefully the answer I posted in the other thread helps.

The X and Y coordinates you can pass in to the 3d surface graph as a 1D array of all X values and 1D array of Y values.

The Z heights you pass in as a 2D array of size (X by Y) of heights corresponding to the X and Y.

 

For example, plotting a flat plane of height 1 at X = 0,1,2 and Y=0,1,2

 

X is array

[0,1,2]

 

Y is array

[0,1,2]

 

Z is 2d array (3x3 in size)

[1,1,1]

[1,1,1]

[1,1,1]

 

To dynamically update values, you can start with the Z array as an array of NaN and replace them as you go along.

 

0xDEAD

 

Message 4 of 4
(2,633 Views)