LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

problem with cw3dgraph

Hello.I am a beginner in LabWindows and I have to do a CW3DGraph using an Excel file.I managed to get a shape according to the datas from Excel and I want to plot the max value  on top of the graph.I added the second plot but it does not work as I expected.Besides the fact that it doesn't plot the point where I need, it looses the initial conditions(instead of plotting a smooth surface it plots a lot of points, in the same shape)Maybe I am missing something from the help and from other documentation that I found.(I was able to do this with OGL).Please help me ,any idea will be appreciated.Thank you.
 
 
 
 
Kind regards,
Andreea
0 Kudos
Message 1 of 10
(5,159 Views)
Hey Andreea,

First of all, what function are you using to plot the points?  Are you using CW3DGraphLib_CWPlot3DPlot3DSimpleSurface? 

Secondly, there is a function called CW3DGraphLib_CWPlot3DSetStyle in which you can specify CW3DGraphLibConst_cwSurface as the plot style. 

Additionally, we provide a 3-D Graph Example that ships with CVI.  If you search the example finder for "graph", you can see several variations of the 3-D graph.  You can look at these for correct implementation.

Do either of these functions help?  If not, please attach screenshots of what you mean and provide more detail as to what the problem is.

Message Edited by AndrewMc on 02-09-2007 02:29 PM

Thanks,

Andy McRorie
NI R&D
0 Kudos
Message 2 of 10
(5,133 Views)
Hello again.I am sorry for not giving so many details.I'll try to be more specific now by posting here a few linws of my code and also some images.This is what I use to draw the first plot:
CW3DGraphLib_CWPlots3DItem (plots, NULL, CA_VariantLong(1), &plot);     
CW3DGraphLib__DCWGraph3DPlot3DSurface(graphHandle,NULL,xV, yV, zV, CA_DEFAULT_VAL);
CW3DGraphLib_CWPlot3DSetStyle (graphHandle, NULL,CW3DGraphLibConst_cwSurface);
CW3DGraphLib_CWPlot3DSetFillStyle (graphHandle, NULL, CW3DGraphLibConst_cwSmooth);
CW3DGraphLib_CWPlot3DSetPointStyle (graphHandle, NULL, CW3DGraphLibConst_cwPoint3DNone);
CW3DGraphLib_CWPlot3DSetColorMapStyle (graphHandle, NULL, CW3DGraphLibConst_cwColorSpectrum);
And the image that I get is shown in FirstPlotNorm.jpg and it look how it supose to look.Then I want to point the maximum value of the graph accordind to the datas (AzAngle,Beams,MaxPeak) presented on the right side of the panel and for this I use the next few lines:
CW3DGraphLib_CWPlots3DItem (graphHandle, NULL, CA_VariantLong(2), &plot);
CW3DGraphLib_CWPlot3DSet_Name (graphHandle, NULL, "Plot-1");
CW3DGraphLib_CWPlot3DSetVisible (graphHandle, NULL, VTRUE);
CW3DGraphLib__DCWGraph3DPlot3DMesh(graphHandle,NULL,xVt,yVt,zVt,CA_DEFAULT_VAL);
and the image I get is presented in 2ndPlot.jpg.I don't know why it's green!!!
And more,after I come back at the initial conditions(first lines posted here) I get the image shown in 1stPlot.after.jpg.I cannot understand why it appears like this even if it goes through the same code lines.
I did take a look over the examples presented on Help , but there on plots only with _DCWGraph3DPlot3DSimpleSurface,and I couldn't find any e.g. regardin the implementation of the second plot on the same graph.maybe I really miss something!
Thank you very much for your answer.I hope this message will help understand what I ment on the first place.And maybe you would help get the idea.
Kind regards,Andreea
 
 
Download All
0 Kudos
Message 3 of 10
(5,111 Views)
For the first issue, I'm not sure what could be causing that.  One possibility, however, is that the graph might need to be cleared prior to redrawing the initial condition.  Try using the function CW3DGraphLib_CWPlot3DClearData before redrawing, and see if this helps.

For the second issue, what color were you expecting?  There's a function called CW3DGraphLib_CWPlot3DSetPointColor that might help you set a particular color for this (There's also a corresponding CW3DGraphLib_CWPlot3DSetFillColor and CW3DGraphLib_CWPlot3DSetLineColor for other elements).

If the above methods do not help you out, please post the project and I can look at it further.
Thanks,

Andy McRorie
NI R&D
0 Kudos
Message 4 of 10
(5,068 Views)

Hi.Thank you for replying.I tried to use the next sequence to see what happens:

CW3DGraphLib__DCWGraph3DPlot3DSurface(graphHandle,NULL,xV, yV, zV, CA_DEFAULT_VAL);         //surface 1
Delay(10);
CW3DGraphLib__DCWGraph3DPlot3DSurface(graphHandle,NULL,xV, yV, aaaV, CA_DEFAULT_VAL);    //surface 2

The fact is that surface 2 is drawn after surface 1 is deleted.Is this the normal behaviour?Is there a special setting for deleting prior drawing?

P.S. For the maximum value (second plot) I used PointColor(=vbBlack),PointSize(7.00),FillColor(white).And in  the drawing sequence (for the first plot,not after)   I posted  ClearData.That's the reason why I tried the sequence above.

0 Kudos
Message 5 of 10
(5,060 Views)
Hey Andreea,

If I understand you correctly, you might try using the function CW3DGraphLib_CWPlot3DSetMultiPlot and set MultiPlot to True.  The default value is false, so hopefully this might help you out.
Thanks,

Andy McRorie
NI R&D
0 Kudos
Message 6 of 10
(5,046 Views)

Hi againSmiley Sad.I used SetMultiPlot to true,I should have sent you the entire sequence then.I will attach a programme now and if you'll have a few minutes to take a look at it so that you could see exactly what is my problem.For start ,press PLOT button which will draw an image(coresponding to the FirstPlot.jpg from a former message),then press AbsoluteValues button(RING) and select MaximumValue (it will appear a single green point ,2ndPlot.jpg) and after that press again Absolute Val and select AbsoluteValues to see the third image(1stPlot.After.jpg).And all I want is to know how could I plot the green point on the top of the first plot and eventually to make it black.

From what you see,it is a normal behaviour?

Thank you so much for your time.I hope you will answer me this time too.

Kind regards,

Andreea

 

0 Kudos
Message 7 of 10
(5,026 Views)
Hey Andreea,

Looking at your code was actually very helpful in diagnosing the issue.

The problem that is occurring is that you are using a function (CW3DGraphLib__DCWGraph3DPlot3DMesh) which (as documented in the help) indicates that it will plot the first plot that has MultiPlot set to true.  In order to use this function to correctly plot using the second plot configuration, you need to temporarily set the first plot MultiPlot property to false and then set it back to true.  This should take care of both of the behavior issues that you are experiencing.  Additionally, please note that the Clear function should be actually be CW3DGraphLib__DCWGraph3DClearData(graphHandle,NULL);  

In summary, add the following two lines after CW3DGraphLib__DCWGraph3DGetPlots (in the AbsoluteVal == 1 case):
CW3DGraphLib_CWPlots3DItem(plotss, NULL, CA_VariantShort(1), &plott);
CW3DGraphLib_CWPlot3DSetMultiPlot (plott, NULL, VFALSE);

Then at the end of the callback, use these lines:
CW3DGraphLib_CWPlots3DItem(plotss, NULL, CA_VariantShort(1), &plott);
CW3DGraphLib_CWPlot3DSetMultiPlot (plott, NULL, VTRUE);

Hope this helps!
Thanks,

Andy McRorie
NI R&D
0 Kudos
Message 8 of 10
(5,000 Views)

Hello.Thank you very much for your answer.I did as you said and it worked.I hope I didn't cause you too much trouble.

Kind regards,

Andreea

0 Kudos
Message 9 of 10
(4,956 Views)
It's no problem at all, Andreea.  Good luck with everything, and don't hesitate to post questions on the forums; we are here to help.
Thanks,

Andy McRorie
NI R&D
0 Kudos
Message 10 of 10
(4,941 Views)