10-30-2018 12:53 PM
I have an NI cDAQ and am writing a VI to configure it and acquire data. I have a number of controls (numeric, string and boolean, also clusters of arrays of controls) and would like to be able to save their values to a configuration file.
I have installed the MGI Read-Write Anywhere VIs and am just experimenting to find out how to use them. Is there some kind of user guide for them? I seem to be able to write a file (save_cfg.vi, .jpg). Trying a value of 521.3, for instance, the written file looks like this:
[My section 1]
MGI RWA Section Options=2.0.1 %04Y%02m%02d %02H%02M%S%25u*~|.%d*~|.,*~|.%#_13g
Value=521.3
When I try to read the file, my code read_cfg.vi finds "My section 1" but there is then an "Error 91 at Variant to Data" with possible reasons: "The data type of the variant is not compatible with the data type wired to the input".
I have tried a variety of different data types for the "type" input of variant to data without success. I suspect it is just a matter of having the correct format strings...
Can anyone help? Thanks
Roger
10-30-2018 01:03 PM - edited 10-30-2018 01:05 PM
You are writing and reading different datatypes. Try this
10-30-2018 01:09 PM
As gregoryj replied.
In your case in your read you have the wrong type, and I believe you wire your format to the type. See below:
mcduff