LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

labwindow ini files

Solved!
Go to solution

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

0 Kudos
Message 1 of 12
(6,958 Views)
Solution
Accepted by snoopy_11

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

Message 2 of 12
(6,956 Views)

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.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 3 of 12
(6,958 Views)

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".

 

0 Kudos
Message 4 of 12
(6,941 Views)

Hi,

 

this, too, is a common problem Smiley Wink

 

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)

0 Kudos
Message 5 of 12
(6,937 Views)

i have added the include file before only but still i am getting the  error

 

0 Kudos
Message 6 of 12
(6,932 Views)

Got the solution it was mistake in loading the instrument driver I had copied .fp for easier finding but when i used actual it workedSmiley Very Happy

 

0 Kudos
Message 7 of 12
(6,930 Views)

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.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 8 of 12
(6,922 Views)

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

 

0 Kudos
Message 9 of 12
(6,916 Views)

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)



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 10 of 12
(6,905 Views)