BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Minutiae (that may bite you someday)

 

Match 1D string array.png

 

What if your “Strings” array is empty or “start index (0)” is >= “Strings” array size, you have catch me if you can loop.

To avoid inf loop, you should check for empty array first or modify with Conditional For Loop or modify the condition check “i = (size -1)” to “i >= (size -1)” and rename and relocate the VI to your project dir.

 

-lvABC

 

Message 81 of 131
(11,763 Views)

Darin.K shared this one a little over a year ago.

 

"In this case there is a bonus lesson about using vi.lib VIs, beware of bugs.  This VI contains a doozy, Kudo opportunity for the spotter."

 

I'm still on 8.6 so I don't know if Darren's proposed fix got into LV2011 or not...

 


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

Message 82 of 131
(11,732 Views)

PhillipBrooks wrote:

Darin.K shared this one a little over a year ago.

 

"In this case there is a bonus lesson about using vi.lib VIs, beware of bugs.  This VI contains a doozy, Kudo opportunity for the spotter."

 

I'm still on 8.6 so I don't know if Darren's proposed fix got into LV2011 or not...

 


Ooooops didn't check that post, and it has not been fix in LV2011 SP1.

Sorry, -lvABC

0 Kudos
Message 83 of 131
(11,706 Views)

@lvABC wrote:

...and it has not been fix in LV2011 SP1.

It's fixed in my copy.  Maybe that was fixed with the LV2011 SP1 f1 patch.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 84 of 131
(11,698 Views)

@crossrulz wrote:

@lvABC wrote:

...and it has not been fix in LV2011 SP1.

It's fixed in my copy.  Maybe that was fixed with the LV2011 SP1 f1 patch.



Yes, crossrulz it is fixed in LV2011 SP1.

I’m sorry about that, I had LV2010 SP1 opened and I was replying the post and when I originally posted.

Again sorry, lvABC

0 Kudos
Message 85 of 131
(11,688 Views)

UPDATE:

NI SCOPE SFP fails to launch?  Yes under unusual conditions and there apparently has been a work-around for some time

 

Today I found the reciently released LabVIEW RTE 8.6.1 f5 patch incorporates the fix!


"Should be" isn't "Is" -Jay
0 Kudos
Message 86 of 131
(11,591 Views)

Thanks to Chris Roebuck for finding the following weird behavior.

 

It's possible to have an "empty" array that's not "really empty". Take the following snippet:

 

EmptyArrayIsntEmpty.png

 

As expected, both arrays return a TRUE for the "Empty Array?" primitive, yet the first one returns a non-zero array for the dimensions:

 

EmptyArrayIsntEmpty

 

If you're not aware of this behavior, it could lead to unexpected results, when, for instance, autoindexing the arrays:

 

AreYouReallyEmpty.png

Message 87 of 131
(11,428 Views)

This looks like a candidate for the CLAD exam.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 88 of 131
(11,398 Views)

@jcarmody wrote:

This looks like a candidate for the CLAD exam.


MonkeyShiiit.png

Originally from http://www.codinghorror.com/blog/2010/02/welcome-back-comments.html

 

I hope not! I would never pass to become a CLAD! And thanks to altenbach for pointing me to this thread that further discusses the topic.

 

And for a new bit of minutiae while were's on the zero-dimension topic... (and to follow the rules of this thread Smiley Tongue )

 

Be mindful of "Equal?" primitive equality comparisons. As demonstrated in the snippet below, surprisingly a 0x0 array is "equal" to a 0xN array yet not equal to a Nx0 array:

 

ArrayPrototypeEquality.png

 

Screen Shot 2013-01-03 at 6.38.19 PM.png

 

Again, these minutiae can manifest themselves as esoteric "bugs" and unintended behaviors, especially when relying on auto-indexing -- just know these behaviors are correct, thought not necessarily intuitive, so be mindful!

Message 89 of 131
(11,360 Views)

In my not-so humble opinion, 0x0 = 0xN is a bug (for compare aggregates).  They would have to be completely insane to not.. <quick LV coding>

 

</quick LV coding>

Holy Cr@p!  There is no pre-flight checking of Array dimensions for Equals? in compare aggregates mode!  Why am I yelling?!  If I take a 2D array, chop its last row and compare to the original array it checks all elements and then says I guess it is not equal when it hits the extra row.  At least it does short-circuit when it hits the first nonequal element.

Message 90 of 131
(11,344 Views)