Unzip files within labview

I have been playing around with the new zip functions in labview 8.  I like it, nice and simple.  Then I realized something.  They don't have any functions listed to unzip files?!?!  Am I missing something, or is there another method to call zip files in labview, unzip to a location, and then grab files from the unzip within labview programatically?  The only method I can think of is to have winzip installed on the machine so you can use the command line execute function (but that is an awful method IMHO).  I would have thought that if NI got the license to build zip files they would have also gotten the rights to include the unzipping as well.

Mads wrote:
Unzip functions in native G would be very useful, simply because that code is supported on the RT targets. There is an unzip option in the palette in LV 8.5, but it returns error 2 if I try to unzip anything with it...if the file only contains one file it works, but it retunrs the error and with more than one file inside the archive it fails....is it supposed to work, or is there still no proper unzip support?
I have code I want to move from a PC to a RIO unit, but the lack of a G-version of unzip makes this difficult, the OpenG alternative is not native G so no luck there...It seems the VIs available in LV 8.5 could do the job, if only some minor bug-fixing was done(?)
ZIP/Unzip support as native VIs is not very practical. Compression is a very tricky business and developing such algorithmes in a way that always works is not very easy and quite time consuming, not to mention that LabVIEW is not the ideal invironment to do low level bit shuffling and manipulation.
Combine that with the fact that there are ready made and VERY throughly tested open source libraries with the needed functions (of course mostly in C) and you really realize that trying to reinvint that wheel in LabVIEW itself is simply an exercise in vain.
The OpenG ZIP/UNZIP library is based on the wide spread zlib library that just about compiles on any C compiler that dates from after the early 1960ies and so it should be no problem to grab the according C source code from the OpenG Toolkit depository on sourceforge.net and recompile it with the correct C toolchain for your CRIO realtime target.
Oh and if you mean to transport the unzip algorithme to the FPGA target instead of the realtime target, keep dreaming. Once the FPGA chips start to reach the 1 Billion gate count this could actually start to get feasable. 3 Million gates is really nothing for such a task.
Rolf Kalbermatter
Message Edited by rolfk on 11-28-2007 11:22 AM
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions

Similar Messages

  • Unzip Files WITHIN IFS?

    At a recent demo, Oracle showed how IFS automatically expanded the contents of a zip file uploaded into the db. Now that I have 9iFS, I can't find how to do it... any help?

    Chris, Portal 3.0.9 can do this, but I wasn't aware that IFS could as well.

  • How to read/unzip a specific file within a zip file

    Hi,
    I have a file within a zip file that contains a timestamp - I want to read this timestamp and then create a destination directory for the remaining zip files to be unzipped into. Since I know the name of the file with the timestamp in it I thought I could create a zipfile and use getEntry to get the entry but then other than getting the size and name of the file I can't do much more with it like read it unless I use a stream (zipinputstream) instead of a file (zipfile) - do I have this right?
    Does this mean to get the content I would have to loop through possibly all the files using the stream until I come across the one I want - then get the timestamp and loop through them all again to write them to the destination directory? Or am I reading this wrong - seems a bit round about.
    Any suggestions would be greatly appreciated.
    Thanks

    this works though - and you don't have to loop through all the files - just use the ZipFile:
    ZipEntry ze = zipfile.getEntry("path/to/file");
    BufferedReader br = new BufferedReader(new InputStreamReader(zf.getInputStream(ze)));
    line = br.readLine;Thanks!

  • How to unzip a zip file within another zip file

    I've got code that successfully processes a file within a zip file.
    But now the zip file can also contain other zip files. How can I
    process a zip nested within a zip without actually extracting the
    files? It looks like I need a ZipFile object to be able to take
    advantage of the zip classes for reading zip entries. But the
    ZipFile methods want as an argument an actual file, as opposed
    to some object in memory. I can read the 'inner' zip file into a
    ZipInputStream object, but then how do I make that available for
    processing as a ZipFile? I've searched all over and cannot find
    anything anywhere that talks about working with nested zip files.
    Does anyone have any sample code that does this? Thanks!

    I have successfully done it.
    You cannot have the code - it is proprietary.
    However here are a few pointers:
    o Use ZipStreams rather than ZipFile.
    o ZipStream is just a filter on a stream, so you can have a zipstream open, read a ZipEntry, then ask for a substream for the stuff up to the next ZipEntry. Put a second ZipStream on that substream.
    o As I recall you have to watch out that your inner ZipStream does not do a close. (Everything will get closed.) Instead, there is another ZipStream method that will close without closing all the underlying streams.
    Hope this helps.

  • How can I calling LabView DLL within LabView and pass similar Data Types?

    I am trying to use an Instrument Driver, which is created in LabView6.1 as a DLL. At this point I have only LabView to test this DLL. I was wondering, is there easy way to find out what sort of Parameter or Data Type I should be using.
    How can I pass the following data with in LabView:
    LVRefnum as Type?
    LVBoolean as Type?
    TD1 (a structure) as Type?
    It is funny to see that I am able to create a DLL in labview but having trouble calling it within LabView. I thought, it would be easier to test the DLL within the same environment.
    Basically, I am more worried about the VISA calls that are used in the driver to communicate with instrument. Because, there is no link to �VISA32.dll� in
    the header file, is that handled by the LV Run-time engine? I guess more details are needed on using the LabView DLL within LabView from National Instrument Technical Support.
    Attachments:
    RL5000.h ‏1 KB

    A LVRefNum seems to be an unsigned long data type (32bit). You can cast it
    in LV then use that as a parameter to call the DLL. (an Occurrence type
    seems to be a Ulong32)
    When you created the DLL what was the resulting type for the LVRefNum?
    Happy Holidays
    "Enrique" wrote in message
    news:[email protected]..
    > I see...
    >
    > After doing some research, it seems to me that there is no easy way to
    > find out the type of data, other than looking at the header file and
    > have documents like Using External Code in LabVIEW handy. The
    > following information is from that document:
    >
    > LVBoolean is an 8-bit integer. 1 if TRUE, 0 if FALSE.
    >
    > LabVIEW specifies file refnums using t
    he LVRefNum data type, the
    > exact structure of which is private to the file manager. To pass
    > references to open files into or out of a CIN, convert file refnums to
    > file descriptors, and convert file descriptors to file refnums using
    > the functions described in Chapter 6, Function Descriptions.
    >
    > I know you are creating a dll in LabVIEW, but I am pretty sure the
    > information applies as well and is useful. For your dll this can be
    > interpreted that, rather than passing a LVRefnum, try passing the file
    > descriptor.
    >
    > From the header file, is can be deduced that TD1 is a cluster in
    > LabVIEW.
    >
    > You are right in saying that "more details are needed on using the
    > LabView DLL within LabView from National Instrument Technical
    > Support.".
    >
    > Enrique

  • How do I find the path to a TestStand sequence file using LabVIEW

    My LabVIEW application launches a bunch of teststand sequences, provided it has the complete path to each of them. I want to make it more flexible by providing it just the name of the TestStand sequence so that it will go and find the path to the sequence by searching a directory structure. TestStand has a neat FindFile() function that can do this, but I need to do this from within LabVIEW. Is there a way to do it?

    There are a few ways to do this depending on how you are getting the sequence files.  If you are calling the GetSequenceFileEx method, you can just pass the GetSeqFile_FindFile (0x20) flag in the SequenceFileFlags property.  If you are using the ApplicationMgr.OpenSequenceFile method, this is automatically done for you.
    If you want to use the FindFile function in general, you can use the Engine.FindFile method.
    Allen P.
    NI

  • UNZIP file from ABAP

    Hi,
    I have a requirement to retrieve a zip file from the FTP Server, unzip it to the SAP Server and process the unzipped files. Retrieving the data from the FTP server should work via FTP commands which can be executed from within an ABAP program. However, the problem is unzipping these files via ABAP and put them on the server as well. 1. How to do this from within an ABAP Program? (unix commands?)
    2. Can I unzip these files with or without using the folder structure? (additional parameter for unix command?)
    Kind regards,
    Micky.

    REPORT ZTESTUNIX line-size 400
                    no standard page heading.
    selection-screen begin of block ucmd with frame title text-001.
    parameters: unixcom like   rlgrap-filename.   " ...SAP Interface file
    selection-screen end of block ucmd.
    data: begin of tabl occurs 500,
            line(400),
          end of tabl.
    data: lines type i.
    start-of-selection.
      refresh tabl.
      call 'SYSTEM' id 'COMMAND' field unixcom
                    id 'TAB'     field tabl[].
      describe table tabl lines lines.
      loop at tabl.
        write:/01 tabl-line.
      endloop.
      skip 2.
      if lines = 0.
        write:/ 'NO Occurances were found'.
      else.
        write:/ 'Command was successfully executed' color col_total.
        write:/ 'Number of entries in Search' color col_total,
                 lines color 6.
      endif.
    end-of-selection.
    while running give the command as
    <b>unzip test.zip  -x dir</b>
    then it will unzip test.zip file to dir called dir.
    you can specify the filepath instead of file...
    regards
    vijay

  • Can I open a excel file from labview

    I have a program who write temperature in a excel file and i want to open this file from labview .

    This depends slightly on the amount of data you have stored within Excel.
    You can use the "Labview Functions>>FileIO>>Read from Spreadsheet file.vi" which effectively reads all lines from a text file and converts it into a numeric array.
    Alternatively, if your data structure in Excel is more complex than this, you can use ActiveX calls to Excel to retrieve it.
    Use an "ActiveX>>Automation Refnum" control and select the Excel server class. This will then enable you to access properties and methods of Excel to retrieve data from specific cells and pages.
    The attached example should help.
    Dan
    Attachments:
    Excel_Automation.vi ‏60 KB

  • Unzip file

    Using this code:
    Inflater inflater = new Inflater();
    FileInputStream fis = new FileInputStream("c:\\a\\unzip.zip"); //args[0].toString()
    BufferedInputStream bis = new BufferedInputStream(fis);
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    int len;
    while ((len = bis.read()) != -1)
    bos.write(len);
    byte[] input = bos.toByteArray();
    byte[] output = new byte[2000000];
    inflater.setInput(input);
    inflater.inflate(output);
    to inflate a ZIP file I got following Exception:
    java.util.zip.DataFormatException: unknown compression method
    at java.util.zip.Inflater.inflateBytes(Native Method)
    at java.util.zip.Inflater.inflate(Inflater.java:195)
    at java.util.zip.Inflater.inflate(Inflater.java:212)
    at UnZIP.UnZIP.main(UnZIP.java:27)
    Exception in thread "main"
    What's wrong with my code???
    Thanks
    Frank

    Take a look at class ZipFile.
    o Create one on your input.
    o Get an enumeration of the entries - the headers for your files within the zip file.
    o Ask for the input stream of the file you want.
    o Read the data - it is unzipped for you.

  • Is it possible to call an executable of compiled c code from within LabVIEW?

    I can compile 'genesis' (the name of the code we are planning to use) under unix: it produces an executable which can be
    linked to user-constructed c files which contain specific crossover and/or
    mutation strategies, so once a user has the executable, it is not
    neccesary to re-compile the main GA everytime a user mucks around with the
    combination rules. I think that a question is, can you call the (or any)
    executable from within LabView?
    Thanks
    Alan Homer

    You can call executables using the System Exec VI, which can be found in the Communications palette.
    Try to take over the world!

  • Diffing Files in LabVIEW with Perforce?

    I've read the sections of articles about doing a graphical difference in LabVIEW with Perforce here: http://zone.ni.com/devzone/cda/tut/p/id/4631#toc4 and here: http://decibel.ni.com/content/docs/DOC-1681#Graphi​cal_Differencing, but I still can't get it to work!
    When I right click on a VI from the Project Explorer that is checked out and select Show Differences... Perforce complains that it doesn't know how to do the diff on the files. I assume this is because I haven't told Perforce about the LabVIEW Diff features or the .vi file extension types. How do I this? Is there an article I missed somewhere that describes this step by step?
    Edit: I forgot to mention, how do I use the Compare VIs tool in Tools -> Compare -> Compare VIs? When I do this it bring up a dialog in which the first field is the VI I have open. The second field is blank, and that is the VI that I would compare the VI open to. However, since I am using Perforce, the previous file revision are in Perforce. How do I tell this dialog to compare it to a file that is in Perforce?
    Thanks in advance!

    In the LabVIEW help there's a LVCompare.exe topic; under that, look at "configuring source control with."  Following the directions there will allow you to show differences directly from Perforce.  However, within LabVIEW, this shouldn't be necessary -at least, it's always worked "right out of the box" for me with no further configuration.  Which of the two LabVIEW Perforce clients are you using?  You may need to use the command line version in order for differencing to work properly.
    Compare VIs does not work the way you seem to expect for VIs in source control.  It simply compares any two VIs loaded in memory.  To compare with the latest version from Perforce, use Tools -> Source Control -> Show Differences.  If you want to compare something other than your current version versus the most recent revision in Perforce, you'll need to execute the diff from within Perforce.

  • Dereferenc​ing a pointer from a Windows API call within labview

    I was looking into using the CreateFile windows API funciton within a labview project I'm working on.  I found some C code to do essentially what I want to do with this fuction (c code and details are within the attached VI).  Unfortanatly its return type is a pointer to a pointer and I got a bit
    lost when I looked into how to dereference this pointer to a value.   By
    the way WinBase.h defines INVALID_HANDLE_VALUE as:
    #define INVALID_HANDLE_VALUE ((HANDLE)(LONG_PTR)-1)
    Essentially I need to detect when CreateFile returns INVALID_HANDLE_VALUE to feed into a larger labview program I'm working on.
    So is it possilble to dereference this pointer or should I be looking for another way of getting the same result?
    Attached is the basic mechanism I worked up - the dereferencing block is disabled because it doesn't work.  I looked into the memblock() (CIN function) to do the dereferencing but couldn't find all the pieces to that puzzel yet.
    Thanks for your help,
    Christopher
    Attachments:
    File IO - is file open3-GetValueByPointer.vi ‏18 KB

    Just use "open/create/replace" file in LabVIEW. It should return an error if the file is already open. Just check for that error. If it isn't already open, yes it will open it, but just close it right after.
    CLA, LabVIEW Versions 2010-2013

  • I would like to run Matlab mex file in Labview - how to do this?

    Hello
    In order to run Labview without Matlab beeing installed I have to compile the matlab files, right? So I also want to run those files in Labiew, and I do not know how. Anybody can help.
    Thanks a lot
    kind regards
    Pawel

    Pawel,
    You can create a DLL in Matlab. To compile this DLL you should use both LabVIEW and Matlab typedefs. The Math Works offers a C library with functions for accessing Matlab files. You can use this library to create a DLL. Then import the DLL into LabVIEW by using Call Library Function VI located under Functions>>Advanced palette.
    To call Matlab scripts from within LabVIEW, you have to have Matlab installed on the machine. The Script Node (Matlab script) function is located in Functions>>Mathematics>>Formula palette.
    Here are some useful links:
    - description of those C functions
    [http://www.mathworks.com/access/ helpdesk/help/techdoc/apiref/apiref. shtml]
    - how to download and compile (it will be a little bit different if you want to use CIN)
    [htt
    p://www.mathworks.com/support/ solutions/data/8757.shtml]
    - MAT-file format if you want to develop your own LabVIEW utility to do the job
    [http://www.mathworks.com/access/ helpdesk/help/pdf_doc/matlab/ matfile_format.pdf]
    Hope these suggestions pointed you in the right direction.
    Zvezdana S.
    National Instruments

  • Want to lesen PDF file in labview

    i want tranfer a PDF file to binary String. And store the string in a oracle datebase. First of all, how can i lesen the PDF file use labview?

    Portable Document Format, short pdf, is (in general) an open file format. You can find information about this here.
    So if you can open the file at all depends on if it is encrypted or not (see usage restriction). Another point is that the text you are reading in a pdf-reader is not stored in the pdf like in any other ASCII-file. There are formatstrings, imagelinks (and data) and other things included WITHIN your text. Afaik (short for "as far as i know"), there are no "preprogrammed" pdf-reader available in LabVIEW, but maybe someone else knows a little more about that.
    So if there isn't one, you can only write a pdf-parser on your own......
    hope this helps,
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • How to open an excel file from labview?

    I tried to use "open file" vi from File I/O -- Advanced file functions to open an excel file in LabVIEW. Why the excel file wouldn't open after I run the program?

    In addition to ActiveX, you can also manipulate Excel data files using the Windows ADO interface - a technique that is more robust, faster and IMHO easier. Do a search on the forum as there have been several threads within the last week or so discussing this very thing.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

Maybe you are looking for

  • Safari displays portable web page

    Since updating to Yosemite and Safari8, occasionally Safari loads what appears to be the portable web page rather then the desktop version. This displays the web site as a very oversized page. The only way I can recover is to restart safari, logging

  • Missing M182.cab file when installing Crystal Reports XI Professional

    I am installing Crystal Reports XI Professional onto a Windows XP Professional machine and it gets as far as the m182 cab file and then says that cannot complete as the file is missing. I browsed the CD and the file is missing. I am wondering if  I c

  • The "down arrow" on keyboard is not working.

    The directional downward arrow key is not working.  Up key does work and side-to-side.  Tried aircan dust remover.

  • Execution of RFC

    Hi, I have an RFC ZSM_USER_ALLOCATION where i need to pass certain input like userId,projectId, cadre,skillid and get output from the same.When i pass userId,projectId, cadre output values are fetched in the perfect manner.But wenever i try to pass s

  • Link is not clickable in generated rtf file (https)

    I am using lowagie API for rtf letter generation. I am using the same from the last two years...I ahve made several Links having http://.... in reference..and working fine I mean they are clickable....But Know i am trying to make https://,,,,,, link