LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Local variable writing to control


DFGray wrote:

Local variables are powerful.  You can use that power to help or to hurt...


Ooohhh... succint and all-encompassing. Me likey!

0 Kudos
Message 11 of 19
(1,254 Views)

Hi Putnam,

 

Sorry to take so long to reply.

 

See attached code.

 

R

0 Kudos
Message 12 of 19
(1,217 Views)

The forum wouldn't let me attach an xml file.

 

So here it is.  Simply remove the .txt extension at the end.

 

 

0 Kudos
Message 13 of 19
(1,216 Views)
Thats pretty slick but it doesn't update the controls with the values stored in the config file.  Is there a way to do that with your example?
0 Kudos
Message 14 of 19
(1,147 Views)

What do you mean?

 

The config file in this example is an xml file.  And it gets updated by whatever vaules you change in the control box on the left.

 

I modified the code to include indicators to show the original values from the xml file and the values  that will be written to the file.

See images below:

 

This is before running the program.  The change controls remembered the values from the last run.  You can set these to some initial value and save as default.

 

 

 

 

The top left shows the values that were in the config file.  The bottom left shows the new values that were set.

The bottom right shows the values that were written to the file.

 

 

 

 

Run the program again and the top left corner now shows the new values that were written to the xml file (the current contents of the file).  See, it does update the config file.

 

 

 

 

Message Edited by Ray.R on 02-04-2010 09:34 AM
0 Kudos
Message 15 of 19
(1,115 Views)

Or did you mean that you want the values of the control (bottom left) to be updated with the values from the xml file?

 

If so, then I will modify the example.

0 Kudos
Message 16 of 19
(1,113 Views)
Yea.  When I run the program I want the controls to be updated to whatever is in the config file.  That way, if I only want one thing changed I don't need to remember what was there to begin with.
0 Kudos
Message 17 of 19
(1,096 Views)
Oh.. Now I get it.  Okay.  I can modify the code; however, if you use a control as an indicator, then you will need to use property nodes.  I can modify the code and post it if you wish.  If so, it will have to be later today..  😉
0 Kudos
Message 18 of 19
(1,079 Views)
Thats okay.  I just thought there might be a way of doing it without using the value property node or local variables.  Thanks for your help.
0 Kudos
Message 19 of 19
(1,067 Views)