Mark Balla Posted February 19, 2006 Report Share Posted February 19, 2006 Inspired by the tips and tricks thread. I am starting this post looking for everyone Quote Link to comment
Mark Balla Posted February 19, 2006 Author Report Share Posted February 19, 2006 Another useful tool when building a user interface was given to me by njkirchner. The propose is to put a Front Panel in it correct position at run time. The steps to use it are as follows Position the Parent VI in the desired runtime position. Place the FP size and position vi on the block diagram. Next open the FP size and position vi and click on the Set Values button. Now run the Parent vi and stop it. The position values with be filled in and the Set Value button will be set to false. Create constants on each of the position inputs. Set the Move Window input true if desired Finally if you move the front panel of the Parent to a new location it will always come back to the same spot at runtime. Download File:post-584-1140328475.llb Quote Link to comment
jpdrolet Posted February 19, 2006 Report Share Posted February 19, 2006 I also have a loop utility called LoopContinue that determines if the while loop it is enclosed into should continue or not. The different instances communicate with a notifier so many or all parallel loops can be notified to stop simultaneously. For UI VIs it also has an option to open the FP on first iteration, close it on last iteration and terminate the loop when the FP is closed. This utility is intended to be used in any loop in an application that have to run an indefinite time. When the Application Quit input becomes TRUE in one instance, all instances will abort their wait and stop their calling loop. The Continue output, wired to the continuation terminal of the calling loop becomes FALSE. It is used to terminate the application. When the Group Quit input becomes TRUE in one instance, all instances with the same group name will abort their wait and stop their calling loop. It is used to terminate a specific section of the application like a plugin. When the OK|Close input becomes TRUE, only this loop will terminate. When Manage Caller FP input is TRUE, the VI will open the Caller FP on the first iteration, close it at the last iteration and end the calling loop when the user closes the Caller FP. Download File:post-447-1140347475.llb Quote Link to comment
jhoskins Posted February 20, 2006 Report Share Posted February 20, 2006 I have a vi that I like to use for opening different files and applications. It uses the system exec vi. Who all have probably made better ones for doing this but this is my feable attempt. Download File:post-310-1140461285.vi Quote Link to comment
Mark Balla Posted March 21, 2006 Author Report Share Posted March 21, 2006 Sorry I posted demo vi and not the llb. Thanks to Guillaume Lessard for pointing it out to me Download File:post-584-1142916971.llb Quote Link to comment
didierj Posted March 21, 2006 Report Share Posted March 21, 2006 Here are 2 little vi's I often use: I use both (red to yellow sub-vi's) to deal between development and built app (takes the work for me) - First gives back the root path by removing the the vi-name and the "\blabla.exe\" or "\blabla.llb\". It is quite ideal to load ini-files that reside in the app root directory. - Second checks if the path contains an ".exe". I usually put it at the end of the main vi: if the ".exe" is detected, it gives a true to the "quit lv"-primitive, thus quiting the built app. If not detected it doesn't quit the development environment. Didier Download File:post-253-1142926055.zip Quote Link to comment
Anke Schenk Posted March 24, 2006 Report Share Posted March 24, 2006 One of my favorite Vis is called ToDo. It's function ist to do nothing at all, but exist anywhere on a BD where there is some work left unfinished. It has a bright red icon and a required text input to describe whatever there is left to do. It is an eyecatcher on any BD and easyly spotted in the hierarchy window. A search for all occurrences of this Vi will show you all unfinished parts of your application at a single glance. Quote Link to comment
Yair Posted March 26, 2006 Report Share Posted March 26, 2006 I added 2 VIs to my structures palette which simply have a while loop with a wait and a stop button and a while loop with an event structure and a stop case already set up. By setting them to be merged you can drop a loop ready for a quick testing of something very easily. Note - to modify the palettes you have to rename the readonly.txt file found in the menus\paletteviewname directory. Quote Link to comment
Mike Ashe Posted March 27, 2006 Report Share Posted March 27, 2006 I added 2 VIs to my structures palette which simply have a while loop with a wait and a stop button and a while loop with an event structure and a stop case already set up. By setting them to be merged you can drop a loop ready for a quick testing of something very easily. Note - to modify the palettes you have to rename the readonly.txt file found in the menus\paletteviewname directory. I do this with a couple versions of a state machine template. It's a nice technique. My ToDo list includes converting a lot more basic structures into palettes of merge VIs. Sigh ... So many nifty things to code up ... Quote Link to comment
Ulrich Posted March 31, 2006 Report Share Posted March 31, 2006 I do this with a couple versions of a state machine template. It's a nice technique. My ToDo list includes converting a lot more basic structures into palettes of merge VIs.Sigh ... So many nifty things to code up ... My favorite is a file dialog where the user can only search in specified directories. So he can't do anything wrong. See you Ulrich Download File:post-3940-1143805352.zip Quote Link to comment
Tim Erickson Posted April 6, 2006 Report Share Posted April 6, 2006 Here is a running average VI (LabVIEW 8.0, but would work in LabVIEW 6 and 7 too) that allows you to change the size of the running average array. It is written for an input of type double but can be changed as needed. Also, it is reentrant so it can be used multiple times in the same application. Comments are welcome. Download File:post-2002-1144359314.vi Quote Link to comment
torekp Posted April 21, 2006 Report Share Posted April 21, 2006 Here's a small LLB (LV 8) with some of my favorite Stupid Array Tricks. Array_of_Indices is a tiny little block diagram that I got tired of making over and over. listbox_to_booleans and vice-versa do exactly that. linspace_N_points_DBL creates a linearly spaced ascending or descending series; any resemblance to the Matlab command linspace is strictly in the mind of the author. And my favorite, multiple_indices_from_array, it's simple, stupid, and oh so useful. I wrote it before I learned to do the polymorphic VI thing, and I wonder if it isn't a little faster-executing this way anyway. And besides, it's very handy if you want to index multiple array types with the same list of indices, which I do a lot. Any suggestions, comments, or reciprocation appreciated. I'd share more, but I forgot what it was Jim Kring said about how to keep you-know-who from copyrighting my ideas. Download File:post-4616-1145623818.llb Quote Link to comment
crelf Posted April 21, 2006 Report Share Posted April 21, 2006 I'd share more, but I forgot what it was Jim Kring said about how to keep you-know-who from copyrighting my ideas. I wouldn't be worried about feeping anyone from copyrighting your ideas - your posts (and all their attachments) here on LAVA are covered by the Creative Commons License (see the at the bottom of the page?) so you're safe! If you'd like to go even further and increase your contribution's value to the wider LabVIEW community, check out OpenG: From the OpenG website:OpenG is an organized community committed to the development and use of open source LabVIEW tools, applications, frameworks, and documentation. Through participation and continuous improvement, we empower ourselves and others within our community while creating new opportunities for LabVIEW developers. Quote Link to comment
crelf Posted April 30, 2006 Report Share Posted April 30, 2006 Here's a couple of VIs that will help you sort a multi column listbox based on which column header the user clicks on, and resize the columns in a listbox to the width of the widest test element (essentially expanding to show all items). Download File:post-181-1146403499.vi Download File:post-181-1146403509.vi Download File:post-181-1146404066.vi Download File:post-181-1146404097.vi Download File:post-181-1146572866.vi Download File:post-181-1146572894.vi Quote Link to comment
Vladimir Posted May 2, 2006 Report Share Posted May 2, 2006 Here's a couple of VIs that will help you sort a multi column listbox based on which column header the user clicks on, and resize the columns in a listbox to the width of the widest test element (essentially expanding to show all items). Hi ! Seems to be very usefull, but "Check if Listbox Column Header Clicked.vi" and "Sort 2D Array by Selected Column Values.vi" are missing. vladimir Quote Link to comment
crelf Posted May 2, 2006 Report Share Posted May 2, 2006 ...but <VI list> are missing. Oops - sorry - they should be there now. Quote Link to comment
Vladimir Posted May 5, 2006 Report Share Posted May 5, 2006 Oops - sorry - they should be there now. Hi, Now works fine - wery usefull code. (One VI is still missing "Count Number of Lines in a Multiline string", but the function was clear ...) I have found and fix two small bugs: 1, When you have selected colum last+1, the list was cleared 2, When you have done mouse click on Label above column, the list was reorded too (this is only cosmetic, but some users are perfectionist ...) Vladimir. Quote Link to comment
crelf Posted May 5, 2006 Report Share Posted May 5, 2006 I have found and fix two small bugs: Hey - thanks for the fixes - I appreciate it :thumbup: Quote Link to comment
torekp Posted June 6, 2006 Report Share Posted June 6, 2006 Here's a small LLB (LV 8) with some of my favorite Stupid Array Tricks. Here's another few array tricks, primarily sort_Excel_style, which crelf's multicolumn listbox sorter reminded me of. This isn't as user-friendly, but it allows you to pick multiple columns (or rows instead) by which to sort. So if two lines are "tied" (have the same thing) in column 1, you can break the tie using your second-priority column, say column 9 for example. And if they're equal there as well, then ... and so on for up to 7 "priority" columns. Why 7? It would get more and more clumsy for more priorities (see middle diagram below), and I couldn't figure out how to make it inherently flexible. Download File:post-4616-1149618861.zip Quote Link to comment
torekp Posted November 9, 2006 Report Share Posted November 9, 2006 In this other thread I've discussed a project of mine that is too messy to be Code Repository material. Unzip the attached and open File IO/DirTree__Browser_Plus.vi - It's a GUI for browsing directories, with a pie chart showing relative sizes (bytes) of the items, where the only bytes that count are the files that you're looking for. For example, if you're looking for files VoltageData* and CurrentData*, a folder that has many bytes of those will appear larger on the pie chart than one with few of those but more total data. You can leave the search pattern(s) blank and then all files will count. Directories with what you're looking for will get check-marked, as in the picture below. Any directories that do not have such items will have plain folder symbols. Note that in the picture, two directories have been selected (which really means that the 7 files within have been "selected"). When the user quits, these items' paths will be passed to the calling VI. Some sub-VIs that may be of interest, even if you don't have any use for the main VI: Tree Related: tree_Find_all_children.vi, tree_add_if_new.vi, tree_locate_and_add_item.vi (files item alphabetically within "its kind", as determined by a list of item symbols defining "its kind") File operation: List_all_dirs_many_files (applies "patterns" to filter file listing but not directory listing) GUI: Pie_chart_oriented.vi Array: cut_multiple_indices_1D.vi (polymorphic for i32, dbl, str) String: see picture above. If anybody feels like cleaning this stuff up (or maybe just some subVIs) and making Code Repository material, be my guest, but I'm not feeling up to it. If you find some smallish group of subVIs particularly useful, let me know, and I'll see about cleaning those up myself. Download File:post-4616-1163076885.zip Quote Link to comment
Mellroth Posted November 9, 2006 Report Share Posted November 9, 2006 ... and so on for up to 7 "priority" columns. Why 7? It would get more and more clumsy for more priorities (see middle diagram below), and I couldn't figure out how to make it inherently flexible. Hi, maybe this could be a way to sort on an arbitrary number of columns. Flow Formula - Dwyer Averaging Pitot.vi Attachment is in LV8.20 Download File:post-5958-1163081605.vi /J Quote Link to comment
torekp Posted November 9, 2006 Report Share Posted November 9, 2006 Thanks JFM. I always make things too complicated :headbang: Quote Link to comment
Eugen Graf Posted March 10, 2007 Report Share Posted March 10, 2007 I use this one to create a INI file in application data folder. Sorry no VI available at the moment. http://forums.lavag.org/index.php?act=attach&type=post&id=5165 And this multitasking VIs to start a list of tasks, set values, stop tasks and open FP and bring to front. Eugen Quote Link to comment
TG Posted April 22, 2007 Report Share Posted April 22, 2007 have this LLB in my user lib folder. It's a LV2 global for storing data structures in an array without regard for the data type. It can be used to store an object's current state into memory or to disk. It handles a lot of gory details. All that all that is required from the caller is the following: 1) The data (as a cluster of variant bundled with a enum or string descriptor for that particular data type.) 2) An index for storage into the array of data types. The caller can Put, Get, Replace, and Insert data "elements" in any order, and at any index, (even one that does not yet exist. The VI will create the array element.) Caller can also Put/Get an entire array of elements, as well as storing/retreiving from binary disk file. Range checking and other sanity code are not added, however it should be easy to modify this puppy. Pros: Simple to utilize Very Flexible and adaptable (I think) Cons: Caller must define a descriptor entry for the data type and must re-construct the data on the other end using the descriptor into a case statement (This is not really a bad thing) Disk storage is not human readable or editable. I've not had time to think about what would be involved in adding this capability. The DEMO should be self explanatory. I have found this VI to be re-usable in my work and I hope someone will find it a useful work saver. Regards, John http://forums.lavag.org/index.php?act=attach&type=post&id=5578 Quote Link to comment
Shashi C S Posted May 1, 2007 Report Share Posted May 1, 2007 QUOTE(crelf @ Apr 30 2006, 09:35 PM) Here's a couple of VIs that will help you sort a multi column listbox based on which column header the user clicks on, and resize the columns in a listbox to the width of the widest test element (essentially expanding to show all items). Hey Pal.. How to insert icon in table. Please help me to do this.. Have nice time Regards, Shashi Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.