LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can i change control values based on a read-in file?

Solved!
Go to solution

I understand that controls only have outputs and indicators only have inputs, but I'm looking for some help creating code that has the capabilities of both. Specifically and ideally, my front panel would allow the user to select an old spreadsheet file to read, and those values from the spreadsheet would be displayed. The user could then tweak those values to their liking, and then submit those tweaked values as a new file/overwrite the old/etc. The important part is the the indicating and controlling of the read in values.

 

thanks

0 Kudos
Message 1 of 16
(3,323 Views)

You can use Local Variables (and Property Nodes) to programatically set the values of controls after you have read the spreadsheet.

 

untitled.PNG

 

Also, see here

Message Edited by elset191 on 09-14-2009 12:44 PM
--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 2 of 16
(3,320 Views)

Ok, that's something I hadn't thought about. I will give it a shot.Smiley Happy

Message Edited by csmrunman on 09-14-2009 12:50 PM
0 Kudos
Message 3 of 16
(3,309 Views)

It may be unclear from the picture I posted, but use one or the other.  Using both does nothing for you.  Also, if you have to choose between the two, use the local variable.

 

If you don't know how to get one, right click on the control then create local variable.

--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 4 of 16
(3,302 Views)
Alright, I'm not quite getting how I should wire everything together, and what should be kept. The .vi attached is all as far as I could get. I'm hung up on how the control will get INPUT from the Read for Spreadsheet. Everything after that makes sense. I don't know how a local variable or property nodes could get around that.
0 Kudos
Message 5 of 16
(3,277 Views)
Solution
Accepted by topic author csmrunman

You have to wire the values from the spreadsheet into the local.  The control itself just watches.  What you have wired in your VI sets the control to its current value (Obviously, kinda useless).

untitled.PNG

--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 6 of 16
(3,275 Views)

Alright, that is clearer. I will try that out and hope for the best. Smiley Wink

 

I am slowly getting better at LabVIEW, but some days I just can't program worth a darn. Today must be one of those days where I can't get going.

0 Kudos
Message 7 of 16
(3,271 Views)

Using a local variable works well if I want to view and change a single value, but I want to view and change a few different values that are to be read in from a speadsheet. I have tried creating an array and then inserting numeric controls into the array, on the front panel. The code will run, but there is no output to the array control. I can't for the life of me pinpoint where the issue is.

 

Is inserting multiple numeric controls into the array, not a good idea? Should I just create 3 separate numeric controls and local variables to get around this?

 

 

Message Edited by csmrunman on 09-16-2009 11:48 AM
0 Kudos
Message 8 of 16
(3,230 Views)
What does your file look like?
--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 9 of 16
(3,224 Views)
If what you want to update is a front panel array control, then your code works just fine.  If you want to update multiple individual controls, then it should be obvious that you do not write to a array - you use the index array function and write to a local for each separate control.
Message 10 of 16
(3,223 Views)