06-04-2013 09:27 AM
Hi there,
Im currently doing an aplication and i have the sa e condition as u. My idea was to create a txt with all paths and control inputs that i need and use them as standard inputs. so i dont need to configure anything everytime i run the program, only if i input a new value it will update. maybe there are better ways 😄
complements
06-04-2013 09:38 AM
@asnaev wrote:
Hi there,
Im currently doing an aplication and i have the sa e condition as u. My idea was to create a txt with all paths and control inputs that i need and use them as standard inputs. so i dont need to configure anything everytime i run the program, only if i input a new value it will update. maybe there are better ways 😄
complements
The easiest, most strightforward way is to use a file to store your settings, linke your test file or an ini file.
06-04-2013 09:48 AM
@DroidFreak wrote:
That looks simple, but you're forgetting the fact that LabView has hundreds of modules and I have absolutely no idea how to find those particular modules just by seeing a picture of them (or even seeing them in someone else's program). If this were text code I could easily copy it verbatim, but as it is it doesn't help me because I still have no clue how those modules are found.
Here's what I really need: A detailed explanation of where to find the modules to write to a control, to read/write from whatever file type can store numbers and strings best, and to make something execute after a loop. I can figure out the details of the module layout myself, that's programming and that's what I do. What I can't do very easily is find things in LabView's web of menus.
Actually, with snippets, you CAN pretty much copy things verbatim. Well, "import" or whatever. You probably think we all learned where everything is by taking courses, but really the easiest way of finding what you need is to open up the main palette and click on the <Search> button. Type in a keyword or two describing what you are trying to do. Do that enough times and you start knowing where everything is. Kind of like when you learn a text-based language, you have to look up keywords that you don't already know.
06-04-2013 09:50 AM
Configuration files (ini) are the most robust option. you can design your code to load a default ini at start up. Then, if you so desire, you can give users the option to save current settings to their own custom file. A second button will load a user file to update all relavent controls. Such a set up is ideal for cases where users 1,2,3, etc all have different settings they use when running the code. If everyone uses the same settings, however, just the default file will be sufficient.
Save the default file in the same folder as your vi and wire a relative path to the config vi functions (avoids problems if someone moves the folder).
06-04-2013 09:56 AM
Yes you can make an aplication directory and it will find ur file allways if you move ur program to another directory or folders. Just keep the file in the same place inside ur folder appl.
06-04-2013 10:27 AM
@asnaev wrote:
Yes you can make an aplication directory and it will find ur file allways if you move ur program to another directory or folders. Just keep the file in the same place inside ur folder appl.
This is no longer the recommended way of doing things. Because of Windows security normal users don't have access to modify files under Program Files folder. If your application is installed there and the config files are with it, you will not be able to modify the ini file unless you have the correct privlages. The more correct way is to store the settings under Application Data. This is less intuitive because a config for an application is hidden from the user, but more secure.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
06-04-2013 10:46 AM
Ok, I figured out how to make things execute seqentially. Now I just need to figure out how to write to a control and how to read and write INI files.
06-04-2013 10:48 AM
@DroidFreak wrote:
Ok, I figured out how to make things execute seqentially.
Are you using a sequence structure? If so, you're making one of the classic new LabVIEW user errors. You want to use wires to control execution flow.
06-04-2013 10:53 AM
"You want to use wires to control execution flow."
Why? Are you telling me that LabView is completely counterintuitive like I've been saying all along? And how am I supposed of control execution with wires?
06-04-2013 10:58 AM
@DroidFreak wrote:
"You want to use wires to control execution flow."
Why? Are you telling me that LabView is completely counterintuitive like I've been saying all along? And how am I supposed of control execution with wires?
I'd say it is quite intuitive, a C call function call doesn't return a value until that function is completed. Just like a subVI will not return any of its values until it is completed. You can force data flow by not allowing a subVI to execute because it requres an input from an output of another subVI. This way you will know that the second subVI will not start execution until after the first completes.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord