LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

the method CW3DGraphLib__DCWGraph3DPlot3DCurve does not work

Hello

 

I have problem with 3D graph, I want draw only simple curve, here is my code

 

 

 data1[0]=1;
data1[1]=8;
data1[2]=9;
data1[3]=6;
data2[0]=9;
data2[1]=2;
data2[2]=4;
data2[3]=5;
data3[0]=6;
data3[1]=2;
data3[2]=9;
data3[3]=8;
  
    VARIANT xArray,yArray,zArray;
GetObjHandleFromActiveXCtrl (panelHandle,PANEL_CWGRAPH3D , &graphHandle); CW3DGraphLib__DCWGraph3DGetPlots (graphHandle, NULL, &plotsHandle); CW3DGraphLib_CWPlots3DItem (plotsHandle, NULL, CA_VariantInt(1),&plotHandle);
CA_VariantSet1DArray (&xArray, CAVT_DOUBLE, 4, &data1);
CA_VariantSet1DArray (&yArray, CAVT_DOUBLE, 4, &data2);  
CA_VariantSet1DArray (&zArray, CAVT_DOUBLE, 4, &data3);  
CW3DGraphLib__DCWGraph3DPlot3DCurve (plotHandle, NULL, xArray, yArray, zArray, CA_DEFAULT_VAL);
Thank you for help

 

0 Kudos
Message 1 of 7
(4,142 Views)

Dear Honzik,

in order to do what you want to do, you need to replace:

CW3DGraphLib_CWPlots3DItem

with a function

CW3DGraphLib_CWPlots3DAdd

 

I can visualize it in LabVIEW:

1.png

Hope this helps.

 

If you have more problems, you can have a look at the following forum threads:

http://forums.ni.com/t5/LabWindows-CVI/Adding-plot-in-3D-graph/m-p/1230695

http://forums.ni.com/t5/LabWindows-CVI/problem-with-cw3dgraph/td-p/475090

 

Regards,

0 Kudos
Message 2 of 7
(4,129 Views)

 

Thank you for your answer
but if I replace it, it doesn't draw anything. I have simply task, draw some points into defined positions x,y,z. Plot surface works but there is some 2D array and I need 3D.

 

 

Jan Prudil 

 

0 Kudos
Message 3 of 7
(4,124 Views)

Dear Jan,

it should work in this configuration. Could you post your project files here?

As I wrote before, I used the same ActiveX functions in LabVIEW and it worked.

 

Regards,

0 Kudos
Message 4 of 7
(4,110 Views)

here is my project, it is very simple only for testing 3D graph

thank you

0 Kudos
Message 5 of 7
(4,104 Views)

Dear Jan,

please try:

 

 

                GetObjHandleFromActiveXCtrl (panelHandle,PANEL_CWGRAPH3D , &graphHandle);
                CW3DGraphLib__DCWGraph3DGetPlots (graphHandle, NULL, &plotsHandle);        
                CW3DGraphLib_CWPlots3DAdd (plotsHandle, NULL,&plotHandle);    
            
                double data1[4];
                double data2[4];
                double data3[4];
    
                data1[0]=1;
                data1[1]=8;
                data1[2]=9;
                data1[3]=6;
                
                data2[0]=9;
                data2[1]=2;
                data2[2]=4;
                data2[3]=5;
                
                data3[0]=6;
                data3[1]=2;
                data3[2]=9;
                data3[3]=8;
    
                ERRORINFO i;  
                VARIANT xArray,yArray,zArray;
    
                CA_VariantSet1DArray (&xArray, CAVT_DOUBLE, 4, &data1);
                CA_VariantSet1DArray (&yArray, CAVT_DOUBLE, 4, &data2);  
                CA_VariantSet1DArray (&zArray, CAVT_DOUBLE, 4, &data3);
            
                CW3DGraphLib_CWPlot3D_CIPlot3DCurve (plotHandle, NULL, xArray, yArray, zArray, CA_DEFAULT_VAL);
                
                CA_VariantClear (&xArray);
                CA_VariantClear (&yArray);
                CA_VariantClear (&zArray);

 

 

Regards,

0 Kudos
Message 6 of 7
(4,090 Views)

Thank you, it works.

0 Kudos
Message 7 of 7
(4,084 Views)