Community Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

RyLabs Configuration File Library

Overview

The RyLabs Configuration File Library are a set of VIs to create, read and write a configuration file (*.ini). Unlike the built-in configuration file VIs, this toolkit controls access to the file so that race conditions do not occur. This toolkit also supports comments ("#"), multi-line keys and the ability to write the key if not found while reading which is enabled by default. Variant and control reference data types allow you to quickly save and recall values from the configuration file with minimal effort.

Features:

- Extended Data Type Support: Integers, Unsigned-Integers, Floats, Strings, Path, Booleans, Variants, VISA, DAQmx, Clusters, 1D and 2D Arrays

- Comments supported ('#')

- Read and Write If Not Found capability

- Strings & Paths written in raw format (Ex: MyKey="C:\MyPath")

- 1D and 2D Arrays are tab delimited - Can span across multiple lines

- Smart sense for data types - Parses with or without quotes

- Variant to configuration file support

- Semaphore controlled file access to avoid overwrite conditions

- Minimal footprint (<1MB)

Palette

The RyLabs Configuration File Library is installed to the Addons > RyLabs > Config palette. The palette contains the basic VIs for creating, reading, writing and closing the configuration file (*.ini).

RyLabs Config Palette.png

Block Diagram

Similar to the built-in configuration file VIs, this palette uses polymorphic VIs to select the data type supported. The read and write key VIs also support reading directly from the file

RyLabs Config BD Polymorphic.png

Use the Variant type to expand the read and write capability to clusters and other non-default data types. The cluster element names are used for the key names. Options are included to write the key if not found.

RyLabs Config BD Variant.png

Save and recall front panel control values when your software starts up or shuts down.

RyLabs Config BD Refnums.png

Examples

The RyLabs Configuration File Library comes with a drag-n-drop example from the palette. The example demonstrates the basic functions for manipulating a configuration file (*.ini). Refer to the VIs description for more information.

RyLabs Config Example.png

Requirements

- LabVIEW 2013 or later

- VI Package Manager 2014 or later

Author

Ryan Pacini

Certified LabVIEW Architect | RyLabs.com

Contributors