LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

3D line graph

Solved!
Go to solution

Hello Bob,

Please be the judge of my first SubVI creation!

SUBVI.png

Please let me know your feedback. I tried to fullfill all your tips.

Thank you for all.

Best.

Duarte

0 Kudos
Message 11 of 13
(1,390 Views)

Close!  Notice how putting a sub-VI in there (and giving it an icon that makes it clear what it does) keeps things "neat" so the viewer can concentrate on "Is this going to lead to a proper plot?".  You also posted it as a Snippet, which (a) lets the reader "see the code" right away, (b) reveals the LabVIEW Version, and (c) can be pasted into a Block Diagram for a closer look.  The one (minor) hitch, of course, is that the sub-VI doesn't come with the Snippet -- if you wanted to do that, then you'd put all of your code into a LabVIEW Project, compress the Folder containing the Project, and attach the .Zip file that the compression creates.

 

So there is still a minor problem, naturally involving your sub-VI.  I gather your sub-VI has three "left" inputs, Latitude 0, Longitude 0, and Altitude 0 (why is there a 0 in the names?  Names are for your convenience, and the "0" doesn't contribute to meaning/understanding), as well as an Array input that, hmm, contains Latitude, Longitude, and Altitude (or something related).  What I thought you would have done is to take the Array and use Index Array 3 times (as you did in your Teste code) to get Lat, Long, and Alt, and wire those in to XYZ Az El.  Instead, you have controls that seem to "do nothing" (oops).

 

There is no need for Controls and Indicators except for (a) argument passing (as in XYZ Az El) or (b) interacting with Humans.  Thus Lat, Long, and Alt are completely unnecessary (since your program doesn't use them).  Similarly, are you really going to watch X, Y, Z, Az, and El change every half-second?  Why show the numbers at all?  [Note that it is fine to do this for debugging purposes, but you can debug XYZ Az El by itself -- simply open its front panel, test it by putting known values in its inputs, run it, and look at the values you get at its outputs).

 

One good thing to do with sub-VIs is to minimize the number of connections.  One way to do this is to group related connections into an Array or a Cluster.  You have a built-in Array for the Input, namely the Array of Lat, Long, and Alt (give this a name, like "GeoCoords".  You could similarly have two outputs, "Cartesian" and "Polar", that could be Arrays or Clusters (you can decide on the basis of convenience, as you need to "take the data apart" to build the 3-D plots).

 

Bob Schor

0 Kudos
Message 12 of 13
(1,382 Views)

Hello Bob,

You are right about the many indicators I have. I don't really need them but just to control the process.

About Latitude0, Longitude0 and Altitude 0, they have to be gived in each context. I remember that this project is a small part of a bigger one that I am developing. When finished, the instant values of latitude, longitude and altitude will be passed to the sub-VI instead of the string values that I am using in this test. So, Latitude0, Longitude0 and Altitude 0 are the reference (origin) for my calculations and depends on the specific geographic spot of my ground station, receiving the data from the flying object. So they can change thats why I have the controls to enter the values.

In a few weeks (I hope) I will get back to you with my final project. Then I will need help again because I am getting out of space in my front panel so maybe I'l have to put this 3D graph in a diferent monitor but I still don't know how to do it. 🙂

Thank you!

Duarte

0 Kudos
Message 13 of 13
(1,372 Views)