LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Editing constants in a stand alone application !!

Hello there,
I have designed an application where the user will have to edit some constants in the block diagram. The user's intervention is very critical to the success of the application, and it doesn't happen quite frequently (only once or twice a year) that the user will have to edit the constants, which leaves it worthless to be implemented in the front panel. I would also like the user to have a certain level of authority in order to access the block diagram and change these constants.
 
My questions are:
1- Is it possible, by any means, to edit the block diagram of stand-alone application?
2- If not, does this mean I will have to put these constants on the front panel for the user to edit whenever it is needed?!
3- If the answer to 2 is yes, will the user have to enter the constants everytime the application initializes, or is there a way to save the values even when the application stops?!
 
Thankyou very much for your attention so far...
0 Kudos
Message 1 of 10
(3,086 Views)

Hi Bedair,

if you create an executable, all blockdiagrams will be removed, so you can´t change any constants. If you make controls of your constants, then you can set a start value before you create the executable. So if the user has to change one of them he/she has to do it every time.

I recommend to use an ini file, for example the ini which will build with the executable. There you can define your values and load them at the beginning. You can create your own format, so that you can´t change this values without a special editor. You can insert this editor to your application and only allowed people can use this editor, so you have your security level.

Hope this helps.

Mike

0 Kudos
Message 2 of 10
(3,083 Views)
Mike has exactly the right approach. If you do not want the controls to be seen or changed by the users (except on the rare occasions where they are being modified), you can hide the controls. This can be done manually from the block diagram or programmatically via the Visible property node.

Lynn
0 Kudos
Message 3 of 10
(3,079 Views)
Thanks Mike and Lynn.
 
I have checked the .ini file associated with the executable file, and I have to admit that I do not have a clue of how to access the constants. Using the ini file as a soluton to my problem seems an advanced technique that will take lots of time and effort to master, would you please guide me to the material needed for me to get a good grasp of the technique, especially that my programming background is very minor.
 
Thankyou very much for your patience and prompt response.
 
Bedair
0 Kudos
Message 4 of 10
(3,047 Views)
I think I'd just put a button on the front panel that pops up a dialog to chenge the values. Easier and cleaner than messing with the ini file.
________________________________________________________

Use the rating system, otherwise its useless; and please don't forget to tip your waiters!
using LV 2010 SP 1, Windows 7
________________________________________________________
0 Kudos
Message 5 of 10
(3,043 Views)
Hello TWGomez,
This seems like a good idea, but I am afraid the user will have to enter the values everytime the application initializes, is there a way that will save the constants entered by the user on a previous event ?!
0 Kudos
Message 6 of 10
(3,037 Views)
Hi Bedair,
I frequently use configuration files in this way, and it is not difficult.  I do not know how to use the ini file that LV creates for the exe, but if you save a txt file with the values that you wish to be changed, then all you need is a front panel control that triggers a sub vi.  Input from the user is only needed when they desire to do so.  In the sub vi you get user input to change the values and then save them to the txt file.  When the program starts up, you read the values from the txt file and write them to hidden controls rather than constants.


Message Edited by lmtis on 05-02-2008 07:09 AM
Jim

LV 2020
0 Kudos
Message 7 of 10
(3,032 Views)


Bedair wrote:
Hello TWGomez,
This seems like a good idea, but I am afraid the user will have to enter the values everytime the application initializes, is there a way that will save the constants entered by the user on a previous event ?!



Just save them to a config file and load them at start-up. Only need to do a new save if they modify the values.

 

EDIT: And you can roll out a default config file with the default values when you create the executable/installer.



Message Edited by TWGomez on 05-02-2008 07:12 AM
________________________________________________________

Use the rating system, otherwise its useless; and please don't forget to tip your waiters!
using LV 2010 SP 1, Windows 7
________________________________________________________
0 Kudos
Message 8 of 10
(3,028 Views)
You can read and write configuration files using the VIs in File I/O >> Configuration File VIs palette.  For security, you can password and/or write protect the file using the OS security settings.  Since it is a text file, it is easy to edit if you have the permissions.
0 Kudos
Message 9 of 10
(3,011 Views)
Hello everyone,
 
Thankyou very much for the variety of ideas so far, it was extremely helpful, and I chose to go with the configuration text file, I'll let labview read the constants from the text file everytime it starts, and I'll let the user alter the constants whenever needed at a certain security level.
 
Thanks agai to everyone who has contributed to this...
 
Bedair
0 Kudos
Message 10 of 10
(2,980 Views)