04-02-2018 10:33 PM
I've not done much with 3D plots in LabVIEW, so I thought I'd give this a try. Your CSV, as you describe, has 7 columns. The first we ignore, the next three are X, Y, Z for line 1, the last three are X, Y, Z for line 2. So we want to do the following:
Bob Schor
04-02-2018 10:53 PM
Hi SaileshK,
For the XY graph, I tried to replace it with it, it doesn't connect and it shows the source is 2D array and the sink is 1D array of 2 cluster element.
Plus, the XY graph only shows static plot. I need the plot that are moving base on the values of X,Y,Z in the spreadsheet file.
Column 1 in the spreadsheet is the number of frames. Each frame shows the X,Y,Z value of each object. I need a graph that updates the plots base on the value of each frame.
04-02-2018 10:59 PM
Hi Bob Schor,
May I see the block diagram, a screenshot should be fine.
04-03-2018 01:11 AM
Hi Bob Schor,
This is what I got after following the steps you give.
04-03-2018 01:02 PM
That's very close. Do us all a Very Big Favor and do not attach pictures, but attach actual VIs (that we can edit, correct, test, etc.). I can't tell what version of LabVIEW you have (but I could from the VI, hint, hint), but I'm guessing it is several years old, as the Read Delimited Spreadsheet function looks different, but should work.
In Step 3, normally when you bring an Array into a For loop, the Input tunnel, by default, is an indexing tunnel. That's what you want -- it will take your 2D array of Rows and Columns and give you just a Row-at-a-time. When you bring the Row into an Index Array function (similar to what you did), it will break the 1D array into six Dbls, which you bring out of the For Loop (again, through the default Indexing Tunnels. You now have the six 1D (X1, Y1, Z1, X2, Y2, Z2) arrays you need. The For loop does not need a Wait -- it will take microseconds, which is just fine.
So you now have 6 1D Arrays. You've almost wired the two Plot Line functions correctly, but Step 7 says that the Class output of the first one goes to the Class input of the second (you've wired input to input). This last step occurs outside the For loop.
Did that Solve Your Problem?
Bob Schor
04-03-2018 09:31 PM
Hi Bob Schor,
Sorry for not giving the VI, and my labVIEW version is LabVIEW 2013.
It is now works, thank you. However, there is one more little thing that I need. I want it moving to show how the line created, to know where it starts and ends. Or maybe that looks like a video of motion.
Attached is the VI that maybe you can check for me if it is correct.
04-03-2018 11:27 PM
I checked it for you. It is not correct. I told you exactly how to fix it, but you apparently didn't know about Arrays, For Loops, and Indexing Tunnels. Please read this, from the "Getting Started with LabVIEW" Introductory material at the beginning of this Forum. You really need to spend a little more time learning the simplest, most basic parts of LabVIEW before trying to do 3D plotting, especially 3D plotting where Time in involved.
Bob Schor
P.S. -- The code I described draws the two 3-D Graphs "as fast as possible", i.e. "all at once". I thought it would be trivial to make the routine into a Movie -- it isn't really difficult, but it is also not trivial, and one can easily go astray (as I did twice). Once you master the "All-at-once" (by following the directions I provided, thereby learning about For Loops, Arrays, and Indexing Tunnels), we can discuss how to turn the code into a Movie.
04-04-2018 02:06 AM
Hi Bob Schor,
Sorry I sent you the wrong VI, my mistake. Attached is the one I have been working on.
04-04-2018 12:29 PM
That looks like what I was describing (my code is on my laptop, at home ...). Does it give you a 3D Plot that "looks OK"? If so, mark one (or more?) of my suggestions as the Solution (only you, the Original Poster, can designate a Solution, which helps other Forum users "know" that an Answer exists).
Bob Schor
04-04-2018 10:03 PM
Hi Bob Schor,
Yes, it shows the same output as yours. Thank you!!.
However, maybe we can discuss on making the drawing like a video as soon as possible.