NI Home > Community > NI Discussion Forums

BreakPoint

Showing results for 
Search instead for 
Do you mean 
Reply
Member
lvABC
Posts: 81

Re: 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

 

Active Participant
PhillipBrooks
Posts: 1,174

Re: LabVIEW Minutiae (Match 1D String Array.vi)

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

Member
lvABC
Posts: 81
0 Kudos

Re: LabVIEW Minutiae (Match 1D String Array.vi)

[ Edited ]

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

Proven Zealot
crossrulz
Posts: 8,329

Re: LabVIEW Minutiae (Match 1D String Array.vi)


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.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Member
lvABC
Posts: 81
0 Kudos

Re: LabVIEW Minutiae (Match 1D String Array.vi)


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

Proven Zealot
Jeff·Þ·Bohrer
Posts: 7,748
0 Kudos

Re: LabVIEW Minutiae (that may bite you someday)

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!

8-Ball Consulting advertising banner

Certified LabVIEW Consultant. The partner you can bank on when you're behind the 8-ball.
Trusted Enthusiast
JackDunaway
Posts: 2,576

Re: LabVIEW Minutiae (that may bite you someday)

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

Wirebird Labs: Expert Toolkits for LabVIEWDeploy, by Wirebird Labs: Expert Toolkits for LabVIEW
Active Participant
jcarmody
Posts: 1,987

Re: LabVIEW Minutiae (that may bite you someday)

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
Trusted Enthusiast
JackDunaway
Posts: 2,576

Re: LabVIEW Minutiae (that may bite you someday)


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 :smileytongue: )

 

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!

Wirebird Labs: Expert Toolkits for LabVIEWDeploy, by Wirebird Labs: Expert Toolkits for LabVIEW
Trusted Enthusiast
Darin.K
Posts: 3,878

Re: LabVIEW Minutiae (that may bite you someday)

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.