Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Configuration value on program start

I am not sure that it is a right thread or should it be in just LabView section.
I have USB 6008 and I have created procedure of writing configuration file on exit (it writes values of different controls, Double, Boolean,string, etc.) and works fine. I have created procedure of reading of configuration file as well and it works. But I can not wire it to controls. I would like to have this values loaded and made default on program start. Is it possible? I have placed this procedure outside main while loop. Can somebody help me to make it right.
 
Thanks. Sergey.
0 Kudos
Message 1 of 11
(3,856 Views)
I think that all you're missing is that you need to write to a local variable of the control and not the control itself.
0 Kudos
Message 2 of 11
(3,847 Views)

Could you please take a look and wire one of them to where it should be.

 

0 Kudos
Message 3 of 11
(3,845 Views)
Here it is. All you have to do to create a local variable is to right click on the control/indicator and select Create>Local Variable. By default, the local you create is something you write to. You can change it to read by right clicking on it and selecting Change to Read. Local variables are the best way to handle your configuration file settings but they can be (and often are) misused. Because they violate datalflow, using them can result in race conditions so use them cautiously.
0 Kudos
Message 4 of 11
(3,840 Views)
OK. I'll take a look tomorrow at work. Thanks a lot.
Sergey.
0 Kudos
Message 5 of 11
(3,837 Views)
OK I did as you told me, but now I can not change values in my controls.
I have tried to change local varibale to read  and the wire becomes broken.
What did I wrong?
Sergey.
0 Kudos
Message 6 of 11
(3,826 Views)
Hi sergey,
 
You need to place the local variables before you enter the loop- not in the while loop.
Inside the loop everytime you go through another itteration, the local variable to reinitiate the values.  That is what's going wrong.
Write to all of the local variables before you enter the while loop and the values will only be written to once. (at the start of the program)
 
I have have attached the solution to your problem.  (You do however need to tidy up the code)
 
Is that what you need?
Hope it helps
 
Many thanx
 
AdamB
Applications Engineer
National Instruments
Applications Engineering Team Leader | National Instruments | UK & Ireland
0 Kudos
Message 7 of 11
(3,819 Views)

Thanks AdamB,

that was bloody simple. If I only paid a bit more time to think about it.

What do you mean to tidy up code. Are there some suggestions about my programming?

Thanks. Sergey.

0 Kudos
Message 8 of 11
(3,817 Views)
ha ha no,
 
I just meant cause I have placed the local variables all over the place at the start of the code.
 
(and after reading my last post I don't think I was thiking too hard when I was typing that message.. sorry.. Wrote a bit of jumbled up English there!)
 
AdamB

Message Edited by AdamB on 10-12-2005 06:15 AM

Applications Engineering Team Leader | National Instruments | UK & Ireland
0 Kudos
Message 9 of 11
(3,816 Views)
There is no problem for me to take some suggestion from people here. We are always learning something.
Thanks again.
Sergey.
0 Kudos
Message 10 of 11
(3,811 Views)