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.
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.
07-17-2015 03:21 AM
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.
Solved! Go to Solution.
07-17-2015 04:03 AM - edited 07-17-2015 04:03 AM
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.
07-17-2015 04:07 AM
Thank you very much for answering that fast ! It works !
07-17-2015 05:12 AM - edited 07-17-2015 05:13 AM
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.