LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MGI Read Anything not displaying correct values

Hi all,

 

I've been experimenting with MGI Write/Read Anything. I am able to write data and save into an ini file. And yet when I try reading it with a separate VI, the correct values in the file are not being displayed in the front panel. Instead it is the default values of the TypeDef wired into Type of Anything of the Read Anything. If I were to remove the type definition, the same problem persists.

 

I'm not getting any error warnings so I'm not sure what I'm doing wrong. Attached is an extremely simplified sample vi. 

 

Thank you in advance.

Download All
0 Kudos
Message 1 of 5
(1,865 Views)

The main problem is that the elements in your typedef'ed cluster are *unnamed*.  When you show their labels, all are empty strings.

 

MGI R/W Anything depends on these labels to identify the items within the cluster and it can't work with ambiguous empty labels.

 

Also, you didn't specify a 'Section Name' in the Read code.  That needs to be the same as the Section Name used when you write.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 2 of 5
(1,835 Views)

Yes, I figured out that was the problem after posting the question, but thank you.

 

Tangentially, I was also wondering how to split the data in sections under specific names, and I realized you could place several Write Anything one after another using the same path and Read according to the desired named section. Or is there a better way to do that?

0 Kudos
Message 3 of 5
(1,828 Views)

If I follow you correctly, sure, you can string together several Writes where each one designates receives a different subset of your config data and a different section name.  Just connect up the path out and error out from one to the path in and error in of the next.

 

I often have code with several parallel "instrument manager loops" and a single overall config file for all of them.  I give each loop the file path, then each one reads its own particular section using MGI Read Anything.   It's like having an Easy button!

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 4 of 5
(1,799 Views)

@Kevin_Price wrote:

If I follow you correctly, sure, you can string together several Writes where each one designates receives a different subset of your config data and a different section name.  Just connect up the path out and error out from one to the path in and error in of the next.

 

I often have code with several parallel "instrument manager loops" and a single overall config file for all of them.  I give each loop the file path, then each one reads its own particular section using MGI Read Anything.   It's like having an Easy button!

 

 

-Kevin P


Yeah, I was just wondering if that was the "right" method for writing a single config file. At first I thought that we should use "Write Everything" VI  only once (similar to writing a text file) where each section is built using something like a build array with a corresponding string for section name but that didn't seem to work......

0 Kudos
Message 5 of 5
(1,793 Views)