LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need Help Loading Default Values

Hi.  I'm very new to LabView (I've been teaching myself for a week for work), I've been able to figure my way through so far, but I ran into a problem I couldn't figure out.
 
Currently the program has the user set numeric inputs that sends info to an instrument that is used to control a piezoelectric and it works fine if you want to boot it up and set all the info manually.  What I want to do is have the user be able to select the serial number of the piezoelectric and have it initialize to different values for each different S/N.  I can get it to do this behind the scenes, but what I'd really like to do is have these preset values be put into the numeric input boxes so the user can see exactly where it's starting from and make any variations as necessary.  The problem I'm encountering is that you can put an input into a numeric input box and you can't wire another source (in this case a constant defined for each serial number) into its output.  Any help you could give me would be greatly appreciated.  Thanks.
 
If you need any clarification let me know.
0 Kudos
Message 1 of 7
(3,323 Views)

The easy answer is to store the data in a file, load it at the beginning of the code and also reload it when ever the sensor is changed.  You should encapsulate this in 2 functional sub vi - load config and store config.  The load event will take a serial number and return values for all settings, and the save takes the serial number and settings and a location on where to store the information, and returns an error cluster is it fails.  The tricky part is how and where to store this information.  The most popular methods (there are a few threads on this) are ascii text files, xml, .ini files and inside a database.  The tradeoffs are difficulty or programming vs flexibility.  Speed and space requirements are usually no longer a bottleneck in a task like this.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 7
(3,313 Views)

Also you can set the default values using make current values default, but these will be static,

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 3 of 7
(3,312 Views)
Thanks for the quick response, but that's not really the problem I was having (either that or I'm not understanding your reply).  The problem I have (and remember I'm very new at this) is how do I take the values once I already have them and make it so they display on the numeric inputs (which would then allow the user to alter them).  As far as I can see, the numeric controls have no way to input a value to them other than by typing one in the GUI.
0 Kudos
Message 4 of 7
(3,305 Views)
You can use a property node to programmatically change the value of a control or to read the value of an indicator. Be careful not to create a race condition (where data may be changed by one part of the program before or after another part tries to use the data). If you are using the event structure, the Value(signalling) property may be useful.

Lynn
0 Kudos
Message 5 of 7
(3,296 Views)

Right-click on the control in the diagram and do a "Create local".

The local that is created will let you wire values to it.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 7
(3,294 Views)
Thanks a lot Ben, that took care of the problem.
0 Kudos
Message 7 of 7
(3,278 Views)