From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

PlotLine Thickness

Solved!
Go to solution

Hello everyone,

 

I'm making a project in LabWindows/CVI where I have to display 16 traces.

I did it with a StripChart, but I had to restart with Graph because I wanted to use the zoom function.

 

Now, I can display my 16 traces on the Graph but I encounter a problem with SetPlotAttribute. Here is a part of my code (simplified) :

 

 

for(int k=0 ; k<16 ; k++){

        PlotLine (panelHandle, PANEL_GRAPH, tempsEcoule, k+1, tempsEcoule+delaiCommande[i], k+1, VAL_GREEN); 
        SetPlotAttribute (panelHandle, PANEL_GRAPH, PlotLine, ATTR_LINE_STYLE, VAL_SOLID);
        SetPlotAttribute (panelHandle, PANEL_GRAPH, PlotLine, ATTR_PLOT_THICKNESS, 4);

}

 

It compiles but it crashes. I have warnings : "incompatible pointer to integer conversion passing 'int(int, int, double, double, double, double, int)__attribute__((stdcall))' to parameter of type 'int'

 

I'm sure it's no big deal but I really don't know what to do now ...

 

Thanks for any help !

 

Regards,

jerome_gab.

0 Kudos
Message 1 of 4
(4,356 Views)
Solution
Accepted by topic author jerome_gab

PlotLine returns an handle thet you must use in subsequent calls to set plot attributes:

for(int k=0 ; k<16 ; k++){
        plotH = PlotLine (panelHandle, PANEL_GRAPH, tempsEcoule, k+1, tempsEcoule+delaiCommande[i], k+1, VAL_GREEN); 
        SetPlotAttribute (panelHandle, PANEL_GRAPH, plotH, ATTR_LINE_STYLE, VAL_SOLID);
        SetPlotAttribute (panelHandle, PANEL_GRAPH, plotH, ATTR_PLOT_THICKNESS, 4);
}

You are using a function definition instead, hence the error you are getting.

 



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 4
(4,335 Views)

Thank you very much for answering that fast ! It works !

 

0 Kudos
Message 3 of 4
(4,332 Views)

You're welcome!

This item is described in the help for SetPlotAttribute function: you should always check the exact type of parameters required by a function when you get that kind of incompatibility errors.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 4
(4,310 Views)