10-09-2010 11:22 AM
Hi,
recently I was stuck with code where I was plotting different data sets on a xy graph: plot 1 used the bottom x axis and the left y axis, plot 2 used the top x axis and the right y axis. If plot 1 was deleted, I wanted to make the right y axis inivisible and reassign plot 2 to the left y axis using SetPlotAttribute (in order to reduce the complexity of the graph).
Unfortunately I did not see a possibility to obtain the scaling behavior (manual, autoscale) and the plot assignment (left/right axis) during debugging: After program execution stops at a breakpoint it would be nice having the possibility to examine these properties, similar to the possibility of using the variable editor: does such a feature exist?
Thanks a lot!
Solved! Go to Solution.
10-11-2010 09:04 AM
Hello,
sorry for the bad message, but there is no feature to examine these properties after setting a breakpoint.
A possibility what you can make is that you can write the attribute in a variable and read these variable with the variable editor out.
Best regards,
Maria
10-11-2010 09:31 AM
Thanks! I took the opportunity to suggest this feature in the brand new CVI Idea Exchange
10-11-2010 10:53 AM
As a poor man's solution, you can run this code in the interactive window when you're suspended.
Or, if you prefer, you should be able to run the function panel for GetPlotAttribute directly.
#include <userint.h> static int axis; GetPlotAttribute(1/* your panel id */, 3 /* your graph id */,
1 /* your plot id */, ATTR_PLOT_YAXIS, &axis);
10-11-2010 11:27 AM
Hi Peter,
Thanks, this sounds like a viable (intermediate) solution! Intermediate because it's not very comfortable as the interactive window does not know the constants used in the suspended code (panel, control_id...) and one has to obtain them manually.
Now, when I try your suggestion and write
#include <userint.h>
GetAxisScalingMode (1, 26, VAL_BOTTOM_XAXIS, NULL, &min, &max);
in the interactive window I receive the error:
Undeclared identifier 'NULL'.
In which include file is NULL declared?
10-11-2010 11:32 AM
NULL is defined in a few header files: utility.h, udpsupp.h, ansi_c.h, and toolbox.h
10-11-2010 11:39 AM
Thanks, Luis!
10-11-2010 11:38 PM
For whichever element in your program, you can click on it and press Ctrl+I (or right click and use Go to definition) to directly reach the file where the element is defined. This works after the project has been successfully compiled at least once.
10-12-2010 12:00 AM
Thanks Roberto,
I wasn't aware that this works not only for function definitions, but also for constants - good to know!
10-12-2010 01:39 AM
You're welcome!