Writes a value to a key in a specified section of the configuration data identified by refnum. This VI modifies data in memory. To write data to disk, use the Close Config Data VI. Wire data to the value input to determine the polymorphic instance to use or manually select the instance.

Format the content of an .ini file correctly when you use this VI.


icon

Inputs/Outputs

  • cstr.png section

    section is the name of the section in which to write the specified key.

  • cdlrn.png refnum

    refnum is the reference number of the configuration data.

  • cstr.png key

    key is the name of the key to write.

  • cstr.png value

    value is the value of the key to write.

  • cerrcodeclst.png error in (no error)

    error in describes error conditions that occur before this node runs. This input provides standard error in functionality.

  • cbool.png write raw string? (F)

    write raw string? specifies whether to write the string without escaping unprintable and backslash (\) characters.

    If FALSE (default), the VI converts any backslashes (\) to double backslashes (\\) and replaces any remaining unprintable characters in the string, such as <ESC>, with a backslash and two Hex characters (\xx). If TRUE, the VI does not convert the unprintable characters in the string.

  • idlrn.png refnum out

    refnum out is the reference number of the configuration data.

  • ibool.png found?

    found? is TRUE if the VI found the key in the specified section.

  • ierrcodeclst.png error out

    error out contains error information. This output provides standard error out functionality.

  • If key exists, the VI replaces the existing value. If key does not exist, the VI adds the key/value pair to the end of the specified section. If section does not exist, the VI adds section, with the key/value pair, to the end of the configuration data.

    Examples

    Refer to the following example files included with LabVIEW.

    • labview\examples\File IO\Configuration (INI)\Configuration (INI) File.lvproj