Saving and Loading Control Values to and from a File in LabVIEW

코드 및 문서

첨부파일

모두 다운로드

Overview:

This VI will save all your VI's control values to a file by converting them to an XML string.
Description:
The VI will also load these values into the VI's controls.
Requirements:

  1. LabVIEW 2012 (or compatible)

Steps to Implement or Execute Code:

  1. Run the VI.

Additional Information or References:

read_load_controls.png

"**This document has been updated to meet the current required format for the NI Code Exchange.**"

National Instruments
Applications Engineer

NI 커뮤니티에 있는 예제 코드 교환의 예제 코드는 MIT 라이센스로 라이센스가 부여됩니다.

의견
WG-
Member
Member
날짜

Very nice. Didn't know this was possible, this code will surely help me with a project I have.

pritam15
Member
Member
날짜

really thank you

WG-
Member
Member
날짜

I just tested the VI but I notice that it doesn't work ;( It goes bad when the loaded xml string needs to be flattend by the "xml flatten vi" it says

     Error 1106 occured at Unflatten From XML in Save or Read Control Values To and From a file.vi

     Possible reason(s): LabVIEW: The XML tag describing the type of data does not match the wired type.

You know a solution?

A_Patel
NI Employee (retired)
날짜

Looks like there is a bug in LabVIEW 2009 that does not allow Variants to faletten to XML. I modified the code to make it work. Try the new download. Not as clean, but does the trick.

National Instruments
Applications Engineer
WG-
Member
Member
날짜

Pity... because the xml was pretty readable now it isn't anymore because you don't know what value the data represents.

mmiers
Member
Member
날짜

Good Idea but I had to change the scheme slightly to get it to work in 8.6.1.

http://decibel.ni.com/content/docs/DOC-13949

smallmediumlarge
Member
Member
날짜

Late to the party, but this helps a lot, thanks!