LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding plot in 3D graph

Solved!
Go to solution

Hi,

 

I'm using the ActiveX plotting function to show a 3D illustration of impedance vs frequency vs time. Everything works fine. Now I want to add a second plot to the same graph without removing the first. I read and tried everything/topic in this board already but I just can't persuade CVI 😞 I'm using the Plots3DAdd command for this. Every single plot PLOT1 & PLOT2 works if I comment the second one. But together I'm always getting a positve (0) return value for Plots3DAdd, but a negative one (-274...) for the second Plot3DSurface command.

 

The interesting part of my code is in the following:

 

 

// 1-dimensional arrys xVt, yVt, 2-dimensional zVt

GetObjHandleFromActiveXCtrl(panelHandle, PANEL_GRAPH3D, &graphHandle);
CW3DGraphLib__DCWGraph3DGetPlots(graphHandle, NULL, &plotsHandle);
CW3DGraphLib_CWPlots3DItem(plotsHandle, NULL, CA_VariantInt(1),&plotHandle);

// PLOT1
CW3DGraphLib_CWPlot3DPlot3DSurface(plotHandle,NULL,xVt,Test,zVt,CA_DEFAULT_VAL);

// Add a 2nd plot
retval=CW3DGraphLib_CWPlots3DAdd(plotsHandle,NULL,&currentPlot);
 
// PLOT2
retval=CW3DGraphLib_CWPlot3DPlot3DSurface(currentPlot,NULL,xVt,yVt,zVt,CA_DEFAULT_VAL);

 

 

It will soon drive me crazy as this problem already occupies me for 3 days. I'd really appreciate every help or hint!

 

Thanks for reading!

 

Michael
--------------------------------------------
LabWindows/CVI 2009 / 9.1.1
0 Kudos
Message 1 of 5
(4,329 Views)

Hi Michael,

 

did you include a call to CW3DGraphLib_CWPlot3DSetMultiPlot (plotHandle, NULL, VTRUE) ?

0 Kudos
Message 2 of 5
(4,313 Views)

Hi Wolfgang,

 

thank you for your reply! I did so as well in the "Edit ActiveX control" menue in the gui as in the code. I didn't mention it in the code example above, because it did not change anything in the result. I just tried again and still got a negative return value and no plot. Is there anything else which might block / suppress the correct output.

 

Thanks.

Michael
--------------------------------------------
LabWindows/CVI 2009 / 9.1.1
0 Kudos
Message 3 of 5
(4,307 Views)
Solution
Accepted by MichaJ

Hi Michael,

 

I think you were pretty close. I attached an example how to use multiple plots in 1 graph. I think you have to call the Add function first before you actually plot something.

 

Hope this helps!

Andreas Stark
LabVIEW Lead @ Rocket Factory Augsburg
Message 4 of 5
(4,276 Views)

Hi Andreas,

 

thank you so much for your effort. I tried to implement this into my code - it doesn't work. Then I finally put this into an older save file and I got the desired results! The only difference between both of them is that I'm using the NIReport ActiveX driver in the current version of my software. Could this maybe be an incompatibility? I will find out during the next days and repost!

 

Thank you all for your help!

Michael
--------------------------------------------
LabWindows/CVI 2009 / 9.1.1
0 Kudos
Message 5 of 5
(4,268 Views)