From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there an easy way to get a "recent files" menu with a path control?

If not, does anybody have any modular code that would do the trick? I could build this from scratch, but I'm sure it's been done many times already.
0 Kudos
Message 1 of 14
(2,942 Views)

Hello,

It sounds like you want a recent files list in the main menu, kind of like Microsoft Word.  I recently developed two subvis that do the trick (for a different application, though), but they can conform pretty much to any menu.  It would require an INI file in the same directory as your top level VI.  Is this what you need?  I'll post more details if this is.

7J1L1M

0 Kudos
Message 2 of 14
(2,904 Views)
Yep, that's what I need. Before posting it, please test it with no other VI's open, as others on this forum will likely want it.
0 Kudos
Message 3 of 14
(2,892 Views)


@bmihura wrote:
Yep, that's what I need. Before posting it, please test it with no other VI's open, as others on this forum will likely want it.


Are you refering to password locking the subvis?  Or do you mean you want me to make sure it can work with any top level VI?  If the latter is true, then the answer is YES.  It will work with any menu.  It will place a list of recent files (it will limit them to a specified number, which is configurable) just above the last option under your first menu group.  So say you have the "File" menu first, and your last option is "Exit," then the File menu would look like:

Before:

New...

Open...

Close...

----------

Exit

 

After:

New...

Open...

Close...

----------

"Name of recent file 1"

"Name of recent file 2"

---------

Exit

 

Now of course your menu probably won't look just like that, but as long as the recent files list can put itself beside the last option (with a seperator), it will work fine.  Let me know if you have any more questions before I post the subs.

7J1L1M

P.S.  They run on LabVIEW 7.1, but I can save them to 7.0 if that is the version you have.

0 Kudos
Message 4 of 14
(2,876 Views)
No more questions, post away!
0 Kudos
Message 5 of 14
(2,862 Views)

Here they are (in LabVIEW 7.1).  I'd put them in an llb, but I don't have access to LabVIEW temporarily.  You need to have the included subvis in the same directory as the INI file, since this is how the subvis keep track of recent files.  Feel free to ask if you have any questions on using the subs!  Just as a note: "Add Recent File" and "Load Recent Files" are the main subs.  The latter would be used at program initialization, and the first for adding a recent file.  Both make adjustments to the menu.

Please check the readme file.

7J1L1M

0 Kudos
Message 6 of 14
(2,854 Views)
I'm using LabVIEW 8.2, but it thinks two of your LabVIEW 7.1 VIs are newer (Add Recent File.vi and Load Recent Files.vi).

Attached is a bitmap of the error message. Any idea what's going on?
0 Kudos
Message 7 of 14
(2,824 Views)

I'm afraid that since I don't yet have LabVIEW running on my new computer, I can't test them, but I tried them within this month's time and they have never given me an error.  Did you notice that when the error said that the vis were created in a "more recent version of LabVIEW," there is no such thing yet?  Currently LabVIEW 8.2 is the most recent.  Have you been able to convert LabVIEW 7.1 vis to your version before?

7J1L1M

0 Kudos
Message 8 of 14
(2,817 Views)
I've been able to convert all 6.x and 7.x VIs to 8.x so far. Another weird thing: Three of your VIs convert, two do not.
0 Kudos
Message 9 of 14
(2,813 Views)
I tried to open 'Add Recent File' and I can't with 7.1. It keeps trying to load itself. It looks like this one VI got currupted somehow.
0 Kudos
Message 10 of 14
(2,810 Views)