Hello dear LabVIEW community.
Does anyone know if there is a way to hook LabVIEW Options Window (Tools menu bar) in order to add a custom configuration panel? For example when you install FPGA and Mathscript they are new menus you can access (cf. screenshot). I don't know if this can be achieved through LabVIEW project providers but I can't find any information about this subject.
Thank you in advance to anyone who can provide help or informations.
Solved! Go to Solution.
You'd need to start looking in this directory: C:\Program Files (x86)\National Instruments\LabVIEW 2019\resource\dialog\PreferencesDialog (or your equivalent, for 32/64-bit and LV version)
In there are the "PreferencesDialog.vi" which gives the frame, and then a subdirectory for "PreferencePages", which contains a folder for each page.
You might be able to add a folder and have it display, but I haven't tried.
Inside that directory (the PreferencePages, not one of its subdirectories) is a template VI called "pageTemplate.vit". That seems like a good starting point for your own page, and lists some details you should follow.
I'm also interested in getting this working
I've rooted around program files and can't find where to "enable" the new page. I think it should be possible as when you download new modules, new items appear in the options window.
Let me know if you have more luck
Thank you cbutcher for the information.
Tom I'm also trying a few things with these VIs but nothing is working. A little documentation from NI would be so helpfull. I have found this link https://forums.ni.com/t5/Reference-Design-Content/LabVIEW-Options-Dialog-Framework-ODF/ta-p/3526554?... but I am not sure it explains how to registrer new pages.
Can't find much documented on this, but you can do it with pure G code.
Check out this folder: \LabVIEW 20XX\project\
VIs added to that folder appear in the tools menu (after a LV restart, the menu is filled during launch).
If you want to add a submenu, add a named folder.
If you want to hide things, pre-pend the folder or VI names with an underscore and they won't show up.
Look through that folder, you'll see what I mean 🙂
I migh not have been enough accurate in my first post but I don't want to add a new submenu in Tools menu but in the parameters window (see the screenshot in my first message).
Unfortunately, shipping LabVIEW does not provide a way to plug in to the Tools > Options dialog. All of the pages (even the FPGA and MathScript ones) are hard-coded in the LabVIEW C code.
However, I have a workaround for you, if you don't mind overwriting a shipping VI in your LabVIEW folder. Follow these steps:
1. Backup the following VI: [LabVIEW 20xx]\resource\dialog\PreferencesDialog\PreferenceDialog.vi
2. Replace that VI with the one attached to this post (LabVIEW 2014 or later).
3. Create the following folder: [LabVIEW 20xx]\resource\dialog\PreferencesDialog\PreferencePages\User
4. Create a new VI from the following template: [LabVIEW 20xx]\resource\dialog\PreferencesDialog\PreferencePages\pageTemplate.vit
5. Save the new VI from step (4) into the User folder you created in step (3), making sure to save the VI with a prefPage_ prefix.
6. Mass compile the PreferencesDialog folder.
Congratulations, you now have your own page in Tools > Options. A couple of things to keep in mind:
a. Change the window title of your prefPage VI, and that's what will appear in the page list in Tools > Options.
b. Don't change the connector pane of your prefPage VI.
c. Don't do anything with any of the 'TagSet' references in your prefPage VI. These are used by the C code, which you're bypassing. This includes removing the subVI call in the <Close Event> of the event structure.
d. Since you aren't using the 'TagSet' stuff at all, you'll need to implement your own handling of reading/writing configuration. Assuming your page uses the LabVIEW INI file to store configurations, you can do this with the VIs here: [LabVIEW 20xx]\resource\dialog\lvconfig.llb.
e. If you add multiple pages, they will be added to the end of the Tools > Options list in alphabetical order based on prefPage VI file name.
Alrighty, have fun. Hopefully it's obvious that everything above is definitely *not* supported by NI through official channels. I did, however, file Bug 1004153 to see about adding these hooks to a future LabVIEW release.
Many thanks this is exactly what I was looking for ! I tried a couple of things with PreferencePages folder but I was missing the "PreferenceDialog.vi". You just saved me hours of blind research ^^
Since I intend to release the tool I'm developing for internal purposes at first there is no problem to edit LabVIEW VI files and manage my own storage for settings but it would be very cool if the system could be fully integrated with LabVIEW. And it could make IDE customization tools a lot easier to share publicly.
a bit sad Darren was faster. 🙂
I have a pretty similar solution but without changing the original PreferenceDialog.vi file so you can have it a bit more under control.
I only renamed it to "PreferenceDialog (original).vi" and call it from my wrapper (attached).
I modified the rules to be the same - prefPage_ prefix in the User directory but you can collect those pages paths your own way.
pageUserTemplate.vit is a modified template using LabVIEW.ini.
Extra tip: You can call this new PreferenceDialog.vi directly for testing your own pages.
Tested in LabVIEW 2017, saved for 2014.
FYI to all, Nicolas sent me a PM asking about another possible extension point. Since I couldn't find a way to send attachments in private messages, I'll post the reply here in case it helps anybody else.
Nicolas also wanted to know how to add his own pages to the EXE build spec properties dialog. Those pages are defined in the following VI: