07-15-2013 12:21 PM
I am new to Labwindow/CVI . I need to write INI files for device configuration, If anyone can post few examples and related docs and links it would be very helpful
Solved! Go to Solution.
07-15-2013 12:34 PM
Hi,
you may want to have a look at the example ini.cws that ships with CVI.
In general, you can use the NI Example Finder that can be found in the menu Help / Find Examples
07-15-2013 12:36 PM
CVI comes with an instrument to read/write .INI-style files: you can find it in toolslib\toolbox\inifile folder. There is also an example that shows yu how to use the instrument: I suggest you search it with the Example finder (Help >> Find examples menu item).
You can also search in the forums with inifile keyword, which returns lots of posts with useful informations.
07-16-2013 12:53 AM
Thank you for the reply I tried out the same procedure I getting below error , I have include inifile.h
Undefined symbol '_Ini_PutString@16' referenced in "Simple_DIO_Example.c".
07-16-2013 01:13 AM
Hi,
this, too, is a common problem
You will need to add the line
#include <inifile.h>
to your source code, and the file inifile.fp to your project (Edit / Add Files to Project)
07-16-2013 01:33 AM
i have added the include file before only but still i am getting the error
07-16-2013 01:38 AM
Got the solution it was mistake in loading the instrument driver I had copied .fp for easier finding but when i used actual it worked
07-16-2013 02:11 AM
That's because the .fp isn't the only file involved in this matter. Now that you have the correct instrument loaded, you can go to Instrument >> Edit... menu function, select the IniFile instrument and press Show Info button: you will see that together with the .fp (which contains the panels for the functions in the instrument) there is also a .obj file which CVI uses in compiling and linking your programs.
By the way, if you plan to use IniFile instrument extensively in several projects, you can load it in the library menu (Library >> Customize...): this way you won't need to add it to every project where you want to use it, and save some compiling second while opening the projects, since CVI does not need to compile the instrument every time.
07-16-2013 04:24 AM
can you please help me in configuring the labwindow ini file where I have to configure values for the number of channels used using ini files
07-16-2013 05:53 AM
There is really nothing to "configure" in that instrument: the structure of the .INI file you want to creat / access is totally in your hands.
Supposing you want to store some parameters to define an acquisition decive, you must define a section, e.g. "Acquisition", and then define the single items that will go into that section, for example "Channels" or "Device", being the first an integer and the latter a string. After you have planned the file structure, you simply create the proper strings to store informations, e.g.
Ini_PutInt (IniTextHandle, "Acquisition", "Channels", 3);
and the instrument will create a file like this:
[Acquisition]
Channels = 3
(do not forget to create the IniText handle first and to call Ini_WriteToFile last)