LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

copy 3D graph into other 3D graph

And this is the reason why I wanted to "hoover" data from 3Dgraph.
LV 2011, Win7
0 Kudos
Message 11 of 21
(1,291 Views)
And this is the reason why I wanted to "hoover" data from 3Dgraph.
LV 2011, Win7
0 Kudos
Message 12 of 21
(1,292 Views)
Hey Ben,
Attached is an example of what I was talking aobut: "There are outputs from the PlotGraph invoke node that duplicates the data that you passed into your first graph. Why not wire the outpus from this graph to the inputs of your second graph?" The outputs from the invoke node are "variant" data type and can be passed into another Invoke node for another graph.
0 Kudos
Message 13 of 21
(1,268 Views)

There is something about that construct that hits me like "finger-nails on a black board".

WIring into and out of the same selection is what seems odd.

I think I will stick with the the other approach.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 14 of 21
(1,263 Views)

I have to agree with you on this one Ben.  It looks just strange, however I looked at the buffer allocations and LabVIEW seems to be using the same buffers for both graphs.

If you change the wiring to go straight to both graphs, every array is copied (which makes sense).  However, the pass through method doesn't seem to.

I am not exactly sure how or why this is happening, but in this 1 case it may be better.

Message 15 of 21
(1,259 Views)

"I am not exactly sure how or why this is happening..."

Data is being converted to variant (I believe). I do not think this happens if variant data is presented to the first graph.

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 16 of 21
(1,251 Views)
The variant conversion doesn't fix it.  Take a look at the attached.
 
The top method of using the pass through allocates at the To Variant, and then in the 1st graphs x and y vectors.  (I assume the z uses the to variant buffer).  However, the second graph does not re-allocate x,y,z.
 
The bottom method allocates at the To Variant, the x, y, and z of the top graph and the x and y of the bottom graph.
Message 17 of 21
(1,245 Views)
I know it looks weird, but anything that limits gratuitous data duplication is OK in my book.
Message 18 of 21
(1,244 Views)
I have made another simple example, that shows what I mean. There is no way to connect the original 3Dgraph with the copy as was shown in examples.
So, tell me please now how to create a copy on button click, pls!
LV 2011, Win7
0 Kudos
Message 19 of 21
(1,216 Views)
Ok I think we have some options here, but it really depends on exactly how you want your application to work.  Ever since we started this conversation I have been thinking about using subpanels.  You can insert a VI in the subpanel, and then remove it later.  So you could create a VI that all it has on the panel is the 3d control.  So you put a sub panel on the main VIs panel and then insert that vi in the panel.  When you want to pop up the big display we simple remove the VI from the sub panel and then popup the VI.  There is actually only 1 3D graph, and therefore no copies.  However, in this case when the copy/large view is up there will not be a graph on the main VIs panel.
 
Another route that may work out really well is to use a single element Queue.  The appraoch may be too complex for the application, but it can be a really nice way to hold the data as a 3 element cluster.  Basically you would create a Queue with a size of 1 and everytime you want to change the data you de-queue the data, then you bundle the new data and enqueue it.  This takes advantage of how labview handles Queues and clusters.  You should not have too many copies here.  The only other part this needs is that the Graph itself would need to know when to update.  Depending on how you impliment it you can simply call a vi to draw it, or you could send a notification or any number of ways.  It really depends on if you are using subpanels etc.
 
As a side note and I know I am throwing a lot at you, I would lean away from using parrellel case structures like you are.  There is a chance that the user hits 2 of the booleans fast enough that they are both processed.  This could lead to some very strange behavior in your vi.  I would suggest looking at some of the state machine examples and the event structure examples to clean up the code.  We can look at that route also if you need help.
 
 
 
0 Kudos
Message 20 of 21
(1,202 Views)