LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use MGI's Read Write Anywhere

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

Download All
0 Kudos
Message 1 of 3
(2,707 Views)

You are writing and reading different datatypes. Try this

Capture.PNG

 

0 Kudos
Message 2 of 3
(2,697 Views)

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:

Snap20.png

 

 

mcduff

0 Kudos
Message 3 of 3
(2,684 Views)