LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in conditional for loop with an empty array

Solved!
Go to solution

Here is a VI that demonstrates the error - some cases work, some don't. Just run the VI.

 

All 'Size' arrays should be the same.

 

Notice that strings behave differently than numbers or booleans - probably due to different memory allocation.

 

Trevor

0 Kudos
Message 11 of 19
(1,856 Views)

Aha! Now I see it! Yes, running your vi in 8.5.1 demonstrates this bug. In 8.6 it does not occur.

 

 

Message Edited by Thoric on 05-06-2009 08:54 AM
Thoric (CLA, CLED, CTD and LabVIEW Champion)


Message 12 of 19
(1,835 Views)

Oh, now this is odd. If I open a blank vi, and drag and drop your entire vi block diagram into it, then run it, I get no bug:

 

 

It might be worth you running my vi (attached) to see if you get this error. If not, then something is awry with your LabVIEW! 

Message Edited by Thoric on 05-06-2009 08:59 AM
Thoric (CLA, CLED, CTD and LabVIEW Champion)


Download All
Message 13 of 19
(1,833 Views)

If I run your VI I get no error unless I make a trivial change that (I presume) requires recompilation.

i.e. moving things or adding labels has no effect; adding a boolean constant outside the main loop does.

 

Thoric: Does editing my VI make the error go away?

 

 I will try a clean reinstallation of LabVIEW.

 

Trevor

0 Kudos
Message 14 of 19
(1,815 Views)

Trevor,

 

If I recompile your vi (Hold CTRL and click Run), the error goes away. The problem seems to be with the compilation. I'm running 8.5.1 by the way, are you using 8.5.0?

 

Thoric (CLA, CLED, CTD and LabVIEW Champion)


Message 15 of 19
(1,810 Views)

I am running 8.5.0.

Could someone with this version try the example please?  So I can determine whether it is my system or a bug in 8.5.0

 

I have tried both a 'Repair' and uninstall and reinstall without any change.

 

Thanks, Trevor

0 Kudos
Message 16 of 19
(1,766 Views)
Solution
Accepted by TrevMrgn

Trevor,

 

I justed searched the 8.5.1 bug fixes list (link) and it identifies this behaviour in ID# 4C5BIJV6.

Looks like you need to upgrade, or perhaps the workaround they describe in that document will work for you?

Message Edited by Thoric on 05-07-2009 11:52 AM
Thoric (CLA, CLED, CTD and LabVIEW Champion)


Message 17 of 19
(1,764 Views)

Thanks, Thoric

 

There is no workaround described in the 8.5.1 bug fixes, and that is the only place I can find where it is referenced.

 

I can think of two workarounds:

1: Use an if-empty conditional

2: Prefix/append the array with a dummy element so it is never empty.

 

Is there a link path to this document from the ni.com website? (except the link you just posted in this forum). If so where?

0 Kudos
Message 18 of 19
(1,744 Views)

The workaround is at the bottom of here, which is accessible by selecting the ID# from within the link I provided before. However, on closer inspection, It simply requests the user to recompile their code, which I seem to remember you saying did not work for you now that I think about it.

 

The patch upgrade from 8.5.0 to 8.5.1 ought to be freely downloadable from NI.com if you haven't got it? Try www.ni.com/downloads, then drivers and updates, then searching for LabVIEW 8.5.1

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 19 of 19
(1,740 Views)