LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in CVI 6.0 PlotRectangle function

Hi,
We recently upgrade to CVI 6 from CVI 5. We are using function called PlotRectangle. If x1 and x2 (or y1 and y2) co-ordinates are same then PlotRectangle won't plot anything in CVI 6 while it plots a line in CVI 5. I guess PlotRectangle is working fine in CVI 5 while it is not in CVI 6.
Cheers
Niranjan
0 Kudos
Message 1 of 10
(3,848 Views)
Technically, I don't know that this should be expected behavior, but I couldn't reproduce the problem anyway. My test program in CVI 6.0 plotted a line for the rectangle. Are you line or fill colors set to transparent? Do you have a test program that exhibits the problem?

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 2 of 10
(3,848 Views)
Hi Chris,
I do have a test code which is giving different result on CVI 5 and 6. I am wondering how can I send it to u?
where can i e-mail it or put it?
cheers
niranjan
0 Kudos
Message 3 of 10
(3,848 Views)
You can attach it right here. You will see an attach files button when you are replying to this message. If that doesn't work, send it to our e-mail support engineers via http://www.ni.com/ask.

Chris
0 Kudos
Message 4 of 10
(3,848 Views)
Hi Chris,
i am attaching .zip containing .c, .uir and .h file for test project. Please run it in cvi 5 and also in 6.
Cheers
niranjan
0 Kudos
Message 5 of 10
(3,848 Views)
Hi,
I am following this after a real long time. Did anyone else also observed a strange behaviour in cvi PlotRectangle function?
cheers
Niranjan
0 Kudos
Message 6 of 10
(3,848 Views)
Running your test program in CVI 6.0, I didn't see a line with x1 == x2 or y1 == y2.

You could try the following.
if (x1 == x2 || y1 == y2)
PlotLine (panelHandle, PANEL_GRAPH,
x1, y1, x2, y2, VAL_BLACK);
else
PlotRectangle (panelHandle, PANEL_GRAPH,
x1, y1, x2, y2, VAL_BLACK, VAL_BLACK);

In your test file, I tried changing colors, changing the graph to Hot so I could pan and zoom, retaining the data, using SetPlotAttribute, but I never saw a line with x1 == X2 or y1 == y2.
0 Kudos
Message 7 of 10
(3,848 Views)
Hi,
I am not getting what you observed. My point is we do get a line in CVI 5.0. Same program does not show line in CVI 6. I wanted to report this to NI.
thanks
Niranjan
0 Kudos
Message 8 of 10
(3,848 Views)
I don't see a line in CVI 6.0 either. What I suggested in my earlier comment as a possible work-around for 6.0 (which will also work in 5.0) is to call PlotLine if x1 == x2 or y1 == y2 and call PlotRectangle if not.

Did you try it?
0 Kudos
Message 9 of 10
(3,848 Views)
Thanks for your reply. What I am saying is: YOU DON'T GET LINE IN CVI 6. BUT YOU DO GET IT IN CVI 5. did u try running it in cvi 5 as well? I already have work-around for it. The reason of posting this message is to notify NI about this difference in two cvi versions. I don't know if this change in behavior of PlotRectangle is intensional.
cheers
Niranjan
0 Kudos
Message 10 of 10
(3,848 Views)