LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

access file as if it were a folder (like llb or zip)

I have several files in a folder that I would like to wrap up into a single file for a variety of reasons including simplification of emailing these files.  In the ideal scenario, a file browser dialog opened in LabVIEW would allow the user to select the container file, but my read/write vi's would be able to tunnel in to these files as if they were folders.  Another challenge is that some of these files are data files that continuously get written to, so I don't want to zip and unzip to some temp directory at the beginning and end of the data acquisition.

I did a few searches but I don't even know what search terms to use.  "File" and "folder" are pretty generic and "container" gets me a lot of .NET.

Any suggestions that won't require a lot of recoding?  Ideally it would simply be wrapping/replacing/modfying my read and write vis.  I also just ran across the TDMS vi's, but that looks like it might require a bit more work.

Thanks,
Matt K.
0 Kudos
Message 1 of 8
(3,703 Views)

Hi Matt,

why do you need different files? One solution could be to create your own file format.

Mike

0 Kudos
Message 2 of 8
(3,668 Views)
I have a substantial existing code base, and I would like to minimize the effort needed to change.
The more I read about TDM and TDMS, the more I think that is probably as close to a drop in replacement as I will find.
Matt K.
0 Kudos
Message 3 of 8
(3,656 Views)

If you have LabVIEW 2009 or later (possibly earlier - don't remember when they appeared), you already have VIs for manipulating zip files.  They are in the file I/O pallete.  The "Unzip" vi has a preview function that you can use to search the archive file.  Even if you have those, I would recommend the open source zip file tools from OpenG:

 

http://wiki.openg.org/Main_Page

 

If you've ever gone through a typical Windows explorer file dialog, you've probably noted that Windows XP and later has no trouble navigating zip files.  Unfortunately, the LabVIEW file dialogs and file I/O do not tunnel directly into zip files (at least as of LV 2009 - not sure if 2010 has this capability).  For the file dialog, I'm sure you could use a dot Net based Windows System dialog to gain navigation of the archive.  For writing to files, you'll probably have to write files to temp directory first and then add to the zip file; however you can make that all transparent to your users.

0 Kudos
Message 4 of 8
(3,349 Views)

A different option on zipping: Use 7zip via the command line (System Exec). I'm not sure about all it's options, but I think it should be able to add a file to an existing archive.

 

Felix

0 Kudos
Message 5 of 8
(3,341 Views)

So you want a dialog that allows users to only select folders?

Perhaps limited to folders with a specific extension (NI has a lot of actual folders on Windows that use an llb extension).

 

It's not that hard to roll your own dialog based on the LabVIEW file functions limiting the options for showing elements.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 6 of 8
(3,297 Views)

hi i have files inside a folder , how can i access it continuosly using labview vi

0 Kudos
Message 7 of 8
(3,184 Views)

Hi dfs,

 

you should have created a new thread instead of hijacking an old one with an unrelated question...

 

There's a Listfolder function in the file functions palette. It will help you to know the names of all files in a folder so you can access them...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 8
(3,175 Views)