LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error file read in Applcation builder

OK, I have fixed your code--at least partially.
 
  1. Notice how I did the selection between the development path and the executable path. This is a better approach because with a case structure wired in this way it is clear what code will be executed in which condition.
  2. You misunderstood what I meant when I talked about duplicated code. You had 4 copies of the exact same code generating the exact same path 4 times. All you need to do is generate the path once and wire it everywhere you need it.
  3. Another place where you had duplicated code was the subvis for reading the configuration file. They occurred in both cases of the case structure.
  4. I also simplified you password checking logic (bonus!). You don't need the loop. All you have to do is lookup the "Login" in column 0 of the configuration data and use that index to get the required password from column 1. Compare the required password to the "Password" input and you're done...

The flow should be clearer: The code first generates the path to the configuration file. If it doesn't exist, the "Error" case of the case structure creates it. After the case structure the file is read and the file contents are passed on to the password checking logic.

This code works, but I'm not convinced that it will do what you want. Is your intention to have the configuration file be read from the same location regardless of whether the VI is being run under the development system or as an executable? If so, this logic won't do it. As I explained before, the path to the configuration is based relative to a builtin function node called "Default Path". The value that this node returns is determined by a value in the ini file for either LV or your application--depending on whether the VI is running in the development system or as an executable.

If there is no entry in the ini file to define this value, LV or the LV Runtime Engine has to make some assumptions about what to return. In the case of the development system, LV returns the path to where you have LV installed. For the runtime engine, it returns the path to where the executable is. The problem is that this logic will likely result in the file occuring in two different places depending on the environment in which you are executing the VI, and where the executable is installed. Where do you want the configuration file to be?

Mike...

Message Edited by mikeporter on 07-29-2005 06:15 AM


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 11 of 12
(385 Views)

Thanks mike,

Sorry for the delay.

As you said I understood in the wrong way and made the changes that I have posted earlier. What I required is When the program is run in the LV or Application builder it has to create a file if doesn't exits and read from the file created. The development system is used while developing the application in LV and once it is made executable file is created and installed in other PC. If we do so the file may not created in two different locations.

With regards,

Anusree

Message Edited by anusree on 08-02-2005 08:35 AM

Message Edited by anusree on 08-02-2005 08:37 AM

0 Kudos
Message 12 of 12
(379 Views)