Discussion:
2D Cartesian Coordinate Rotation bug?
(too old to reply)
Intaris
2008-08-12 13:10:07 UTC
Permalink
I am seeing unusual behaviour in a program I'm working on.When performing a 2D cartesian rotation, normally things are fine but when I feed it X and Y arrays with zero elements, it seems to "remember" the last set of data sent to it and outputs basically the last set of data instead of size zero arrays.....Can anyone reproduce this?&nbsp; Is this fixed in later versions? I'm using LV 8.2.1, and can't use a different version because the customer insists on it.<img src="Loading Image..."> Shane.Message Edited by Intaris on 08-12-2008 07:55 AM


2D Rotate bug.png:
http://forums.ni.com/attachments/ni/170/348574/1/2D Rotate bug.png
smercurio_fc
2008-08-12 15:40:26 UTC
Permalink
I'm using 8.2 and I don't see that behavior. The function does output an error if you feed in empty arrays, though.
Intaris
2008-08-12 15:40:27 UTC
Permalink
Ah, errors, what are they for again? :smileyvery-happy:I thought I had one once, but then I found out I was mistaken.....Shane.
Intaris
2008-08-12 16:10:11 UTC
Permalink
It DOES give an error (not an error cluster, an error number....) but it still gives out the previously entered set of data.I think this is not the expected behaviour.Please try out the attached VI.Oh, and try to enter data before running the VI, I forgot the "Make current values default" step.&nbsp; Doh!I'm using 8.2.1.Shane.Message Edited by Intaris on 08-12-2008 11:04 AM


2d Rotate bug.vi:
http://forums.ni.com/attachments/ni/170/348691/1/2d Rotate bug.vi
smercurio_fc
2008-08-12 16:40:18 UTC
Permalink
I see the behavior in your implementation, but I did not see the behavior in the implementation I had put together:<img src="Loading Image..."> or this one:<img src="Loading Image..."> VERY strange.Message Edited by smercurio_fc on 08-12-2008 11:17 AM


Example_VI.png:
http://forums.ni.com/attachments/ni/170/348699/1/Example_VI.png


Example2_VI.png:
http://forums.ni.com/attachments/ni/170/348699/2/Example2_VI.png
Intaris
2008-08-12 19:10:05 UTC
Permalink
smercurio, thanks for having a look at the issue.Can you try to make an example similar to mine where I'm calling the SAME vi instance (yours have two copies of the same VI - theoretically no difference since it's not actually set to reentrant, even if the DLL call within IS) first with data, and then without?My Computer has been a bit wierd (LV crashed on me today and otherwise behaves strange sometimes).&nbsp; If you can re-create my VI without problems, then I think I need a re-install the OS and everything else..&nbsp; It IS about time, but I hate doing it.I really hope you can reproduce it.&nbsp; I hate reinstalls.Shane.
altenbach
2008-08-12 19:40:05 UTC
Permalink
Shane, I can fully reproduce this in LabVIEW 8.5.1, so I think it is a bug.
Such a VI should NOT output stale data if the inputs are empty arrays!
Attached is a demonstration of the problem and workaround using complex math. ;)
(I strongly prefer using complex data for xy graph. It is so much cleaner. ;))
<img src="Loading Image..."> Message Edited by altenbach on 08-12-2008 12:22 PM


RotateBug.png:
http://forums.ni.com/attachments/ni/170/348757/1/RotateBug.png


2d_Rotate_bugMOD.vi:
http://forums.ni.com/attachments/ni/170/348757/2/2d_Rotate_bugMOD.vi
Intaris
2008-08-12 19:40:05 UTC
Permalink
Thanks altenbach, I thought I was going crazy (or my PC was haunted by data past...)I'll file a Bug report.Regarding the complex numbers, I came across that the other day reading up on the different data types an XY graph accepts.&nbsp; How's it performance-wise.&nbsp; Sure beats a for loop with a bundle in it.....Shane.
altenbach
2008-08-12 20:10:06 UTC
Permalink
Intaris wrote:Sure beats a for loop with a bundle in it.....


Well, you can also bundle the x and y array without the loop.&nbsp;
&nbsp;
(Go back to your code, right-click the inner FOR loop, and "remove for loop".)
&nbsp;
======&gt; Look, no broken wires, just different colors!!
&nbsp;
I have not done much benchmarking, but I don't expect the differences to be dramatic (not orders of magnitude ;)).
&nbsp;
&nbsp;
Don't forget to also post a link to here in the <a href="http://forums.ni.com/ni/board/message?board.id=BreakPoint&amp;thread.id=6195&amp;jump=true" target="_blank">August 2008 Bug thread</a>.
Intaris
2008-08-12 20:10:06 UTC
Permalink
Yeah, it'll take an Array for X and an Array for Y, but only when there's a single plot, no? I generally stick to the Array of clusters of Array of X and Y points because it's easily extended to multiple plots without breaking all the code dealing with the data.Having said that, I think I might need to re-think the benefits versus the burden.....Shane.
altenbach
2008-08-12 20:10:09 UTC
Permalink
Intaris wrote:Yeah, it'll take an Array for X and an Array for Y, but only when there's a single plot, no?


You can make an array of such clusters for multiple plots. Works fine.
&nbsp;
Back to the bug:
&nbsp;
Some casual testing show that the same problem (output stale data with empty array inputs) also occurs for 2D shift (See image)
and the 3D variations (tried only 3D shift).
&nbsp;
<img src="Loading Image..."> &nbsp;
I have not tested 8.6.
Message Edited by altenbach on 08-12-2008 01:09 PM


ShiftBug.png:
http://forums.ni.com/attachments/ni/170/348780/1/ShiftBug.png
smercurio_fc
2008-08-12 20:40:18 UTC
Permalink
Shane, I had actually run your example directly, and I saw the behavior as you described it. It makes no sense to me why the function behaves that way when it's inside the loop like you have, and it behaves "correctly" when it's used the way I used it in the examples I posted. Like I said, a very strange bug indeed.
Intaris
2008-08-12 20:40:19 UTC
Permalink
I think it might be a compiler (optimisation) error rather than a function error.&nbsp; Seems to have something to do with re-using the same VI on the block diagram rather than two separate copies of the same (non-reentrant!) VI. Wierd one indeed.Took me a while to track this one down today.&nbsp; Had me searching all over my code until I came across this behaviour.Shane.
smercurio_fc
2008-08-12 20:40:21 UTC
Permalink
Intaris wrote:I think it might be a compiler (optimisation) error rather than a function error.&nbsp; Hmmm... that sounds like a pretty good guess.
altenbach
2008-08-12 23:40:18 UTC
Permalink
I have reported this in the <a href="http://forums.ni.com/ni/board/message?board.id=BreakPoint&amp;view=by_date_ascending&amp;message.id=6377#M6377" target="_blank">bug thread</a>.
&nbsp;
Let us know if you get a CAR #.

Continue reading on narkive:
Loading...