01-30-2006 10:20 AM - edited 01-30-2006 10:20 AM
Message Edited by Darren on 01-30-2006 10:21 AM
01-30-2006 10:39 AM - edited 01-30-2006 10:39 AM
<<< Ok, for some reason my computer froze when I attempted to edit this message, and after my reboot, it wouldn't let me edit the original. So now I'll just reply to my original post with what should have been my original post... 😛 >>>
So anyway, today's nugget involves a cool shortcut with the Open VI Reference function. One of the more common operations we have to do with Open VI Reference involves getting a reference to a VI that resides next to the current VI on disk. When I first started programming in LabVIEW, this is how I did it:
Then, somebody showed me the trick where I didn't need to use Strip Path, I could just construct a relative path with the Build Path function:
Well, the other day, I learned of an even better method:
That's right, if you wire a path constant into Open VI Reference, and the path constant simply contains the name of a VI, then Open VI Reference will look on disk in the same folder/LLB as the current VI to find that VI. So no more Current VI's Path, Build Path, or Strip Path on the diagram! This approach works in LabVIEW 6.0 and later...it may even work in earlier versions, but 6.0 is the oldest version I checked.
Message Edited by Darren on 01-30-2006 10:40 AM
01-30-2006 11:59 AM - edited 01-30-2006 11:59 AM
Message Edited by Philip C. on 01-30-2006 12:00 PM
01-30-2006 12:19 PM
I noticed it when I read the (very long) upgrade notes.
@Philip C. wrote:
one of the most overlooked features of LabVIEW 8
01-30-2006 01:04 PM
Darren wrote:Well, the other day, I learned of an even better method:
![]()
Hmmm... I've been using this for ages! 😉 I must have stumbled on this by accident. (See e.g. 1DFit.llb posted HERE .)
So, the qustion of course remains, why only for VI references?? 😮 Wouldn't it be more desirable to standardize this syntax so it can be used for any file operation?
01-30-2006 01:06 PM
01-30-2006 01:33 PM
01-30-2006 01:56 PM
@jasonhill wrote:
He is part of a prototype hive-mind. Three separate bodies sharing a single consiousness. And he runs on LVRT!
01-30-2006 10:10 PM - edited 01-30-2006 10:10 PM
May be he broke the light velocity barrier or owns a stratoship!
Back to the main topic, Why not float this 'weekly nugget' discussion to the top of the board??
I missed it out the last week's posting!
Message Edited by devchander on 01-30-2006 10:11 PM
01-30-2006 11:36 PM
Hey dev,
Some of your fellow posters have a Breakpoint topic that links to all my nuggets:
http://forums.ni.com/ni/board/message?board.id=BreakPoint&message.id=1669
Enjoy,
-D