LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

debugging xy graphs

Solved!
Go to solution

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!

0 Kudos
Message 1 of 13
(4,661 Views)
Solution
Accepted by topic author Wolfgang

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

0 Kudos
Message 2 of 13
(4,627 Views)

Thanks! I took the opportunity to suggest this feature in the brand new CVI Idea Exchange

0 Kudos
Message 3 of 13
(4,625 Views)

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);

 

Message 4 of 13
(4,614 Views)

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?

 

0 Kudos
Message 5 of 13
(4,607 Views)

NULL is defined in a few header files: utility.h, udpsupp.h, ansi_c.h, and toolbox.h

0 Kudos
Message 6 of 13
(4,598 Views)

Thanks, Luis!

0 Kudos
Message 7 of 13
(4,594 Views)

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.



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 8 of 13
(4,568 Views)

Thanks Roberto,

 

I wasn't aware that this works not only for function definitions, but also for constants - good to know!

0 Kudos
Message 9 of 13
(4,565 Views)

You're welcome!



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 10 of 13
(4,559 Views)