BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

VI of the Day (Week/Month)

Reminiscent of the "Word of the Day" calendars, I will choose a VI (or structure) and you can:

 

1) Look at the context help for the VI (extra credit for reading detailed help)

2) Use it in a simple VI (use all connectors)

3) Explore the behavior with different inputs, does it accept arrays (1D,2D),  different inputs, try to find interesting behaviors

 

If you are one of those users that have used every VI that comes with LV, then feel free to chime in about why a certain VI should or should not be useful in our daily lives.  Any gotchas we should be aware of.  Cool tricks?

 

If you are an advanced user, perhaps there are some functions that you haven't had occasion to use, or perhaps there are new ways to solve old problems.

 

If you are a beginner, feel free to post questions/comments.  I hope you learn two things, how to use the context help and perhaps a new VI or two.

 

Depending on interest in this thread,a certain VI, my day job, etc. this may become VI of every other day, VI of the fortnight, etc.  I don't have LV9 (yet) so in the beginning I will stick to some oldies but goodies.  I will also try to stick to general purpose VIs before delving into some of the more obscure VIs.

 

The first VI is "Scan String for Tokens"  I like this particular one, but feel I have only scratched the surface of its uses.

 

 Enjoy!

Message 1 of 78
(13,318 Views)

One feature I particularly like about "Scan String for Tokens", is the fact that it allows multiple delimiters and (by default) consecutive delimiters are contracted into one. This make it easy to deal with ASCII spreadsheets that have been manually modified (edited) by idiots (e.g. replaced a single space with multiple spaces, replaced tab with spaces, etc.) so it "looks right" in notepad.

 

 

0 Kudos
Message 2 of 78
(13,307 Views)

altenbach wrote:

....This make it easy to deal with ASCII spreadsheets that have been manually modified (edited) by idiots (e.g. replaced a single space with multiple spaces, replaced tab with spaces, etc.) so it "looks right" in notepad.


LOL! Smiley Very Happy

Its funny because my boss has done that before.

Cory K
0 Kudos
Message 3 of 78
(13,304 Views)
Occasionally you see someone mess with the spaces / tabs because they changed the font from courrier to something else (in TextPad for instance).  Then save it back as text.  Open it in Notepad and it's all over the place.  Yep...  that's where this is useful.. 😄
0 Kudos
Message 4 of 78
(13,285 Views)

I love scan for tokens for the reasons mentioned above and also because it's quite capable of searching relatively large strings.

 

It doesn't modify the original string, only the portion it returns as a token.  Because of this, searching for a specific part of a large string causes minimal memory allocation.  The "index" input allows you to maintain the original string until you are finished and then just get rid of the whole thing.  This makes the entire operation quite efficient.

 

Shane.

0 Kudos
Message 5 of 78
(13,277 Views)

Thanks to all of the participants!

 

The VI for today is "Concatenate Strings" 

 

Wait a minute, you say.  Is he giving an easy one because it is Friday?

 

Maybe.  If you have ever written a for-loop with shift-registers to convert a string array into a single string, it is time to read the help.

You are a good LV programmer and take special care to avoid memory thrashing with build array, ever think about it with concatenate strings?

Finally, ever notice that the wires for picture controls look similar to strings?  Coincidence?  I think not. 

Message 6 of 78
(13,233 Views)

Darin.K wrote:
I hope you learn [...] a new VI or two.
[...]
 Finally, ever notice that the wires for picture controls look similar to strings?  Coincidence?  I think not.

I read the help, and I learned something. Thanks for sharing Darin !

 

concatenate_pictures.png

 

Keep them coming.

Regards,

Message 7 of 78
(13,218 Views)

Hey Darin,

 

Do you think it would maybe be better to have separate thread for VIOTD, which could be linked to from this thread?

 

Cool idea though. I'm subscribed!

 

-Randy
-=--=-=-=-=-=-=-
Nothing like a good dose of LabVIEW to cure what ails ya'.
Message 8 of 78
(13,198 Views)

 


RandyP wrote:

 

Do you think it would maybe be better to have separate thread for VIOTD, which could be linked to from this thread?

 

 


 

 

I think that is probably a very good idea.  I wanted to start a little bit off-to-the-side in case I was adding more noise than signal to the main LV board.  The response has been sufficiently positive (thanks again) that perhaps beginning on Monday I will post a new VIOTD on the LV board and keep the links in this board.  Any other suggestions?

0 Kudos
Message 9 of 78
(13,191 Views)

DOH!

call me Mr Rube Goldberg.  Thanks Darin- I'm glad i'm not the only one that missed this interesting feature.


"Should be" isn't "Is" -Jay
0 Kudos
Message 10 of 78
(13,181 Views)