LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with unzip.vi

I have a very simple .vi wired up to unzip a file but I continue to receive this message:

 

>>>>

Error 42 occurred at NI_Unzip.lvlib: Open unZip File.vi 

 

Possible reason(s):

 

Error opening the zip file.

 

Complete call chain:

     NI_Unzip.lvlib:Open unZip File.vi

     NI_Unzip.lvlib:Unzip.vi

     simple zip test.vi 

<<<<

 

A previous poster saw this message with files of a different format, but I know mine should work since I zipped the file in LabView with its ZIP .vi's.

 

I also get curiously different messages depending on whether I have a leading colon in my path (I'm on LabView 8.5.1 on the MacOS).  The message above is generated when I have a leading colon.  When I don't have a leading colon, I get the message:

 

>>>>

Error 1430 occurred at Open/Create/Replace File in NI_Unzip.lvlib:Unzip.vi->simple zip test.vi 

 

Possible reason(s):

LabVIEW:  The path is empty or relative. You must use an absolute path.

<Not A Path>

<<<< 

 

I find this surprising since the .vi I have attached is clearly not a relative path but an absolute path back to my hard drive.  Would anyone have any suggestions?

 

Thanks!

 

 

Download All
0 Kudos
Message 1 of 9
(5,583 Views)

jlbibc wrote:

I have a very simple .vi wired up to unzip a file but I continue to receive this message:

 

>>>>

Error 42 occurred at NI_Unzip.lvlib: Open unZip File.vi 

 

Possible reason(s):

 

Error opening the zip file.

 

Complete call chain:

     NI_Unzip.lvlib:Open unZip File.vi

     NI_Unzip.lvlib:Unzip.vi

     simple zip test.vi 

<<<<

 

A previous poster saw this message with files of a different format, but I know mine should work since I zipped the file in LabView with its ZIP .vi's.

 

I tried your VI and zip file and they worked fine for me. 

 

I also get curiously different messages depending on whether I have a leading colon in my path (I'm on LabView 8.5.1 on the MacOS).  The message above is generated when I have a leading colon.  When I don't have a leading colon, I get the message:

 

Why would you have a leading colon?  That isn't a valid character in a filename.

 

>>>>

Error 1430 occurred at Open/Create/Replace File in NI_Unzip.lvlib:Unzip.vi->simple zip test.vi 

 

 

 

Possible reason(s):

LabVIEW:  The path is empty or relative. You must use an absolute path.

<Not A Path>

<<<< 

 

I find this surprising since the .vi I have attached is clearly not a relative path but an absolute path back to my hard drive.  Would anyone have any suggestions?

 

The VI  you attached doesn't have any paths in it.  Both path controls are empty by default.

 

Thanks!

 

 


 

 

 

0 Kudos
Message 2 of 9
(5,571 Views)

Fair enough, but I still can not get this to work on my computer (LabView 8.5.1 for PowerPC, Mac OS 10.5.8).  The leading colon was an attempt to actually put in a relative path.

 

Last night I ran a mass compile which I have been putting off since I upgraded from 8.2 to 8.5.1 as I thought there might be some uncompiled sub VI hidden in there somwhere, but no luck.  This morning in trying to unzip a file made with the zip functions in LabView I still get the message:

 

 


Error 1430 occurred at Open/Create/Replace File in NI_Unzip.lvlib:Unzip.vi->simple zip test 2.vi 

 

Possible reason(s):

LabVIEW:  The path is empty or relative. You must use an absolute path.

<Not A Path> 


 

 

 

This time around I wired path indicators to prove to myself that I was dealing with absolute paths and not relative paths.  The error message says the path is <Not A Path> but the path type functions clearly indicate that the paths are absolute paths and the "Check if File or Folder Exists" VI clearly shows that the file and folders exist.

 

I am at a complete loss and I really feel like this is a bug in the program.  Is this potentially a PowerPC problem or a Mac-only issue?  I don't have a copy on an Intel Mac to try out...

Download All
0 Kudos
Message 3 of 9
(5,547 Views)

Can you post an example of a .zip file where you have leading colons?  The one you attached does not.  As I said, colons are not a valid character in a filename.  Unless for some reason Apple allows it, in which case it probably shouldn't.

 

Or are you talking about "..\myname.txt" when you are talking about "leading colons".  That is the only thing that might make sense to me when you are talking about relative paths.

 

EDIT:  I now see in your .vi you have a path such as "MacintoshHD:\Users\grimm\Desktop".  That doesn't look right at all.  Normal notation if you are not using drive letters would be "\\MacintoshHD\Users\grim\Desktop" to refer to a drive by name.

Message Edited by Ravens Fan on 08-12-2009 01:32 PM
0 Kudos
Message 4 of 9
(5,543 Views)
Your test code runs fine on a PC.  I noticed that your hard drive letter is MacintoshHD instead of the PC's standard letter (i.e. C).  I don't know if you can easily change that to just a letter to test.  Perhaps the unzip VI doesn't like the hard drive "letter".
0 Kudos
Message 5 of 9
(5,538 Views)

Ravens Fan and Matthew Kelton - These are not productive comments, and they reflect a misunderstanding of how paths are represented on the Mac.  Despite adopting a *NIX style directory structure in Mac OS X, LabVIEW continues to see files and folders with the classic MacOS structure.  For instance, this could be a valid path:

 


hard drive : path : to : file.txt
There are of course no spaces, but I don't want my colon-p's turning into smiley faces. 

 

In this notation colons -- not slashes -- separate folders, and the root is always the name of the drive.  Thus paths starting with the hard drive are absolute, and paths starting with colons are relative to the present working directory.

 

In my example I added "Path Type" and "Check if File or Folder Exists" functions to verify that things exist and the paths are absolute.  This is in fact redundant since I provided the paths in the path select dialog box before the program ran.

 

It is completely possible that there is some little subVI within the unzip.vi that is expecting a DOS/Windows-style directory structure, but this is not the fault of my code, but rather represents a bug in LabVIEW.  I have additionally tested this on a copy of LabVIEW 8.5.1 on an Intel Mac and I get the same response.   I appreciate the testing on Windows that the other posters have performed, and I feel that this is another indication that there is a bug in the unzip.vi code.

 

As a matter of fact, I'm sure of it.  When I change the path to "C:\Users\grimm\Desktop\meh.zip" I get a different error message than the <Not A Path> error.  In this case I get:

 


Error 42 occurred at NI_Unzip.lvlib:Open unZip File.vi 
 
Possible reason(s):

Error opening the zip file.

Complete call chain:
     NI_Unzip.lvlib:Open unZip File.vi
     NI_Unzip.lvlib:Unzip.vi
     simple zip test 2.vi

 

Is there a Mac user out there that could test this?  Otherwise, how do I go about reporting a potential bug? 

Message Edited by jlbibc on 08-12-2009 03:30 PM
Download All
0 Kudos
Message 6 of 9
(5,518 Views)

When I run your VI on an Intel Mac with LV 2009, it does not generate an error.  It lists and unzips the five files which I find when I unzip the test file.  I am not an XML expert but the files look like they came through OK.

 

File path which works fine =  Macintosh HD:Users:johnsold:Documents:Downloads:meh.zip 

 

Lynn

0 Kudos
Message 7 of 9
(5,510 Views)
This has been reported to R&D for further investigation (Corrective Action Request # 182764).

One possible work around could be to use the System Exec.vi and use the command prompt to run the "unzip" command. Help about the System Exec.vi can be found here, and more about the unzip command can be found at this website
Regards,

Jon S.
National Instruments
LabVIEW NXG Product Owner
0 Kudos
Message 8 of 9
(5,472 Views)
You can also try the OpenG zip libraries.
0 Kudos
Message 9 of 9
(5,469 Views)