05-04-2022 02:53 AM
I'm trying to create vi to generate ini file. Setpoint will be controlled from vi.
is possible in LabVIEW??
Thank you
Solved! Go to Solution.
05-04-2022
03:09 AM
- last edited on
04-26-2025
05:38 PM
by
Content Cleaner
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
05-04-2022 03:30 AM
The problem is write key.vi doesnt recognize arrays or clusters.
05-04-2022 03:46 AM - edited 05-04-2022 03:48 AM
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.
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.
05-04-2022 04:26 AM
Hi,
if you want to create ini file that store value from a cluster, you find below an example.
Best Regards.
thank you.
05-04-2022 04:27 AM
section and key I can do it, but the problem is the values must be in square brackets.
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.
05-04-2022 04:39 AM - edited 05-04-2022 04:39 AM
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.
05-04-2022 05:14 AM
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
05-04-2022 08:05 AM
Use Array to Spreadsheet string and use as Value with the Write Key-VI.
05-04-2022 08:33 AM
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.