LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Image viewing program won't work on Win NT

I have a fairly simple VI that reads binary image files from disk and shows them in a picture control. The compiled code works fine under Win 98 (where it was written), but not under Win NT. The problem appears to be with the Open/Create/Replace File.vi when opening a U8 type byte stream file. It seems to return a file size of zero bytes. (I'm guessing this because I don't have Labview on the NT machine). Any suggestions or possible work arounds?
0 Kudos
Message 1 of 5
(2,709 Views)
My guess is that this is almost certainly a common mistake when building applications. If you're using the Current VI's path function, it is different for a standalone VI and one that is part of an exe. You'll have to use an extra strip path function for an exe. If you use the property Application.Kind, you can determine whether you're in the Run Time or Development System and put the extra strip path inside of case statement. Then the program will work both ways. Examples of this have been posted numerous times to the forum. Do a search to find an actual example.
0 Kudos
Message 2 of 5
(2,709 Views)
Thanks for the input. However, I am not using the current VIs path. The path to the file is specified using a front panel control (actually a path control and a string control, combined using the build path.vi function). I found the example code you mention but I don't think this is the problem since I am not using the path to the VI. Also, the compiled application runs under Win 98, its just NT where the problem occurs (using the same installer for both operating systems).
0 Kudos
Message 3 of 5
(2,709 Views)
The only other thing I can think of off-hand is that the security settings under NT don't allow access to the file. Add some error handling to verify that the problem is actually with opening the file and get the actual error code and message generated.
0 Kudos
Message 4 of 5
(2,709 Views)
Opening the file as read-only took care of the problem. Thanks for pointing me in the right direction.
0 Kudos
Message 5 of 5
(2,709 Views)