LAVA Forums Buy cool LAVA gear Forums RSS Feed

Welcome Guest ( Log In | Register )

Tags
(This content has not been tagged yet)
 
Reply to this topic Start new topic
> Bug in simple math with a for loop, Bug
Dean Mills
post Oct 13 2004, 07:12 PM
Post #1


Active
*

Member
Posts: 10
Joined: 18-October 02
From: Canada
Member No.: 5
Using LabVIEW Since:1996
LV:8.6 ,. ,.
Canada Nothing Selected Nothing Selected


Hi all,

A collegue of my found this bug.
There is a bug in LabVIEW 7.1 where if you have a for loop, a constant outside the loop and do simple math, such as subtract on a constant that resides inside the for loop it treats the top terminal as 0 . See attached.

Directions

Place a for loop on the diagram, wire 1 to the count terminal
Place a constant on the diagram outside the for loop, use any postive number.
Place a constant inside the for loop, use any positive number.
Subtract them with the constant outside the for loop wired to the top terminal.
Wire the result of the subtract to the output of the for loop, disable indexing.
Wire the top terminal to the output of the for loop, disable indexing.

Probe the output of the subtract.
Run VI

I have tried add, multiple and divide. Same bad results

This has been submitted to NI as a bug report.

DeanAttached File  Major_Bug_In_loop_math.vi ( 21.18K ) Number of downloads: 340


This post has been edited by damsem: Oct 13 2004, 07:16 PM

--------------------
Dean Mills
Meikle Automation


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Ad
post Oct 13 2004, 07:12 PM
Post #















Tags
(This content has not been tagged yet)
Go to the top of the page
Quote Post
Ed Dickens
post Oct 13 2004, 07:51 PM
Post #2


Very Active
***

Member
Posts: 87
Joined: 31-January 03
From: Cedar Rapids, Ia.
Member No.: 47
Using LabVIEW Since:2001
LV:8.5.1 ,8.2.1 ,8.0.1
United States Nothing Selected Nothing Selected


Interesting

Changing either constant to a control makes it work correctly. It also works correctly in 7.0 and 6.1 with both values being constants.

Ed

This post has been edited by Ed Dickens: Oct 13 2004, 07:52 PM

--------------------
Edwin Dickens - Certified LabVIEW Architect
DISTek Integration, Inc. - NI Alliance Member


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Barrie
post Oct 13 2004, 07:59 PM
Post #3


Very Active
***

Member
Posts: 85
Joined: 4-September 04
From: Canada
Member No.: 658
Using LabVIEW Since:1992
LV:8.20 ,7.1.1 ,8.0.1
Canada ca_alberta Nothing Selected


This has been submitted to NI as a bug report.

DeanAttached File  Major_Bug_In_loop_math.vi ( 21.18K ) Number of downloads: 340

*

[/quote]

VERY strange ! wacko.gif The inside indicator, a probe and execution highlighting all show the constant 60 as being passed correctly.

If the inside and outside constants are reversed, the problem does not occur.

If the outside constant is changed to an array, enabling auto indexing, the problem goes away.

No similar bug exists in the while loop.

I'm amazed that this bug has only surfaced now.


Barrie
Attached File(s)
Attached File  Major_Bug_In_loop_math_II.vi ( 50.71K ) Number of downloads: 200
 

--------------------
There are 10 kinds of people in the world; those that understand binary, and those that don't.


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Jeff B
post Oct 19 2004, 10:16 PM
Post #4


Active
*

NI
Posts: 21
Joined: 23-April 04
Member No.: 371
Using LabVIEW Since:1999
LV:8.5 ,8.2.1 ,8.0.1
Nothing Selected Nothing Selected Nothing Selected


Hello LabVIEW Users,

Thank you for reporting this issue. Prior to 10/13/2004, National Instruments was not aware of this issue, and we apologize for any inconvenience it has caused.

We have since investigated this issue, and I would like to pass along more details about it. This issue occurs when a wire is connected to a For Loop, through the For Loop's diagram, and out the other side of the For Loop, with indexing disabled. Within the For Loop, the wire is branched to one of several operations such as Add, Subtract or Increment. When the original wire comes from a constant or a computed constant and all other wired inputs to the function are also constants or computed constants, the output of the function inside the For Loop can produce a wrong result. The wrong result will either be the constant value itself, or the result which would be produced by the default value for that type, depending upon the operation.

While we feel that this issue should affect relatively few real-world applications, we are presently working on a longer-term solution for this, and will post more information in the NI Discussion Forum thread when it is available.

Jeff Boettcher
Product Support Engineer
National Instruments - LabVIEW R&D


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post

Reply to this topicStart new topic

 




Time is now: 7th January 2009 - 09:37 PM