LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate Config ini file trouble with Write key Setpoint[] = [520,85]

Solved!
Go to solution

I'm trying to create vi to generate ini file. Setpoint will be controlled from vi.

is possible in LabVIEW??

 

Bacil83_0-1651650652254.png

 

Thank you 

 

 

0 Kudos
Message 1 of 17
(1,989 Views)

Yes possible.

Use the palette "Configs file VIs" from "File I/O" and you will be able to do it.

 

To go further :

https://www.ni.com/docs/en-US/bundle/labview/page/configuration-files.html

0 Kudos
Message 2 of 17
(1,981 Views)

The problem is write key.vi doesnt recognize arrays or clusters.

Bacil83_0-1651652937197.png

 

0 Kudos
Message 3 of 17
(1,969 Views)

A config file does not intend to store arrays nor clusters into a unique key.

The section is your array, the key your row and value your value.

 

conf_file.png

 

PS : By using string formating as for example "Voltage;Temperature" and "3;4" you could store an array into a line. Not neat and errors can easily happen.

0 Kudos
Message 4 of 17
(1,959 Views)

Hi,

if you want to create ini file that store value from a cluster, you find below an example.

Emna20_0-1651656361188.png

Best Regards.

thank you.

0 Kudos
Message 5 of 17
(1,945 Views)

section and key I can do it, but the problem is the values must be in square brackets. 

Bacil83_0-1651655482268.png

not in separate sections.

Closed I get was:

 Type[] = "[Voltage,Temperature]"

When I was writing a raw string, but the value is always written with quotation marks indicate is a string.

ini file is for TestStand configuration if that helps.

 

0 Kudos
Message 6 of 17
(1,944 Views)

Not possible to do it in Teststand ?

The other way if Labview is not formatting the output as wanted is to create the output as for a .txt file and then use .ini when saving it. But you will have to create the section and the whole file formating.

0 Kudos
Message 7 of 17
(1,931 Views)

As an alternative to the ini file , I use TOML file format for such purposes to support arrays and subitems.

 

This is available in the VIPM.

It results in nicely readable "near ini" file format

Gernot Hanel
IONICON Analytik Gesellschaft m.b.H.
0 Kudos
Message 8 of 17
(1,914 Views)

Use Array to Spreadsheet string and use as Value with the Write Key-VI.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 9 of 17
(1,877 Views)

IIRC, the NI library always quotes strings. And it's a library, not a class (*sigh*), so no inheritance...

 

This library is (a bit 😊) more complex*, but a lot more flexible (especially if you understand OO):

 

Carya-Automatisering/Configuration-File-Library: Configuration File Library for LabVIEW (github.com)

 

IIRC, strings won't be quoted unless you have an array of strings or if they start with a quote. But you can probably overwrite this in a child...

 

* most complexity is caused by the fact you can choose between by reference (persistent \non persistent) \ by value implementation.

0 Kudos
Message 10 of 17
(1,865 Views)