Jump to content

While loop oddity


Recommended Posts

Original Post:

http://forums.ni.com/ni/board/message?boar...ssage.id=200378

I was trying to make a bit of code in 7.1, win2k do the following:

If an index is contained in a row of a 2D array of integers, output all of the integers for that row, otherwise, just output that index.

My somewhat convoluted VI to do so is attached.

Now, am I overthinking this (which I've been known to do 16x16_smiley-tongue.gif), or is it actually taking a modification of the row downstream and modifying the input array?

I checked this on an 8.20 eval, win xp machine with the same results.

Thanks,

Joe Z.

Reported: # 40DAF67U

Download File:post-2-1156914149.vi

Link to comment

This bug worries me a lot...how can i go on if i can not rely on labview???

So i made some test.

The error occur at the indexing in the while loop.

If we carry the 2d array into the while loop and extract each element using the index of the cycle no more error occurres.

So....there must be an explanation to this thing...

I don't like auto indexing in the while loop...i use them only when are useful even to determine the number of cycles of the for loops. Can it be relate to this bug?

Three Cycles..same operations... only while loop is wrong...

:nono::nono::nono::nono::nono:

It's not possible such a bug!

and.....if the problem is the "+1" module combined with the while loop?

If we substitute the "+1" with a sum with an array of 1 the problem don't occur.

Download File:post-1899-1157618194.vi

Link to comment
Hi, I found that if you enable the Show folding feature the error don't occur anymore :thumbup:

post-223-1157980571.jpg?width=400

post-223-1157980760.jpg?width=400

Dany

Download File:post-223-1157980624.vi

Yikes!

Talk about being on the horns of a dilema!

Since I generally do not auto-index While Loops I'll leeve the "Show Constant folding" off and try to remember not to auto-index on while loops.

Ben

Link to comment

This is indeed a bug in LabVIEW's inplaceness algorithm, the result of an overzealous optimization, having to do with using auto-indexing input tunnels on a While Loop inside another loop. It is slated to be fixed in the next maintenance release.

Craig Smith

LabVIEW R&D

National Instruments

Link to comment
This is indeed a bug in LabVIEW's inplaceness algorithm, the result of an overzealous optimization, having to do with using auto-indexing input tunnels on a While Loop inside another loop. It is slated to be fixed in the next maintenance release.

Craig Smith

LabVIEW R&D

National Instruments

Well, I guess now we know we're going to see 8.2.1 before 8.3 or 9.0 :)

Jaegen

Link to comment
  • 3 months later...
  • 3 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.