LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PDA File Dialog - new or existing file

I am using
Labview 7.1.1 on win XP
Labview PDA 7.1 with Pocket PC 4.20.0
 
I am trying to use the file dialog box to create a file or open an existing file.
 
Creating a new file work with no problem.
 
When I try to open an existing file the following message pops up:
 
Save As
File Exists - do you want to replace the existing file.
 
I don't want to replace the existing file.  I want to read the data in the file if it exists.
 
I tried running the same app on Win XP and it works as expected.  If the file exists it opens the file and reads the data, if the file does not exist it creates a new file.
 
I am attaching a screen shot of the code in question.
 
Any help would be appreciated
Eric
0 Kudos
Message 1 of 9
(4,937 Views)
Hi, Eric.

I'm a little confused by your screenshot -- I don't see where you're trying to actually open the existing file. Can you elaborate on that a little more?

Thanks! Have a nice evening.
Sarah K.
Search PME
National Instruments
0 Kudos
Message 2 of 9
(4,926 Views)

Hi Sara

Thanks for reply.

If a file exist I need to open the file to read the data in the file.

If a file does not exist I want to create a new file so I can write data to the file.

My problem seem to be coming from the file dialog box.  If the file exist it does not set the Exist? flag to true. 

If tried runnig the same code on a PC and the file dialog box works as expected.  If the file exist it sets the the Exist? flag to true.

I'm attaching my code that I ran on my PC.  It can also be used on a PDA.

Do I have the wrong idea about how the file dialog box is suppossed to work?

Thanks for your help.

Eric

Download All
0 Kudos
Message 3 of 9
(4,916 Views)
Hi, Eric.

I ran your code and found that the File Dialog VI worked exactly as I expected: that is, I selected an existing file and the exist? output was true. If you're still not seeing the desired behavior, could you please elaborate a little more on what you're expecting compared to what you're seeing? If you attach another segment of code, could you please send only a very small excerpt? It's much more difficult to reproduce a situation like this (or show that an error is occurring) with that much code.

Thanks! Have a nice evening!
Sarah K.
Search PME
National Instruments
0 Kudos
Message 4 of 9
(4,887 Views)
Hi Sarah
 
I sorry didn't mean to swamp you with code.
 
Did you run the software on a PDA or a PC? 
 
I know the code works on a PC.  I can't reproduce the problem on a PC.  The problem is on the PDA.  When you select an  existing file on the PDA it does not set the exist? flag to true.  That seem to be the only problem I am having. 
 
I will try to modify my code to simplifiy it.
 
Please let me know if you were able to get it to work on the PDA.
 
Thanks again for your help
 
Eric
0 Kudos
Message 5 of 9
(4,873 Views)

Hi Sarah

I'm attaching a modified version of my Code that deals only with the File Dialog Box.  Here are my observations.

Notes: When there is no file in the folder listed above select mode two creates a new file with out any problem.

When a file is in the folder with the file name listed above mode two tries to overwrite the current file and does not set the Exist Flag to true.

When a file is in the folder with the file name listed above mode zero selects the existing file but does not set the Exist Flag to true.

Once again I'm running this on an IPAQ 5550 with Microsoft Pocket PC Version 4.20.0 (Build 14053)

Processor: Intel (R) PXA255

Memory: 126.63 MB

 

Please load this on a PDA and let me know what you find.

Thanks for your help

Eric

0 Kudos
Message 6 of 9
(4,870 Views)
Hi, Eric.

You're right; I had forgotten we were talking about PDA! Armed with that knowledge, I found a known issue on Pocket PC with the v7.1 PDA module that describes just the behavior you're seeing. The issue has been fixed in the 8.0 version of the PDA module.

A possible workaround to determine if the file exists is to check for file size and then look at the error cluster for the "file not found" error. I know it's kind of a pain, but hopefully it won't be too inconvenient.

Sorry for initially forgetting about PDA! Have a nice afternoon.
Sarah K.
Search PME
National Instruments
Message 7 of 9
(4,836 Views)

Thanks Sarah

I'll give your workaround a try.

I appreciate your help.

Eric

0 Kudos
Message 8 of 9
(4,831 Views)
Thanks Sarah
 
Workaround works.
 
Thanks Again
Eric
0 Kudos
Message 9 of 9
(4,828 Views)