ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LV 2012 Flatten To String / Unflatten From String problems

Solved!
Go to solution

I am using a simple flatten to string in order to save a controls setup and then an unflatten from string to read the saved controls.  The problem is, when I try to read the saved file, it returns an error message:  

 

Error 122 occurred at Unflatten From String in Setup Front Panel.vi

Possible reason(s):

LabVIEW: The resource you are attempting to open was created in a more recent version of LabVIEW and is incompatible with this version.

 

Which is bogus, because it was created in the same VI about 8 seconds earlier.  Are there any known issues with this, or any places I might want to look?

 

 

Edit:  This exact code, unchanged from now, was working last night without problems.  In fact, the saved files I tested with last night still work fine, but newly saved files don't load.

0 Kudos
Message 1 of 12
(4,817 Views)

Look at the hex values of the flattened string. There's an LV version number, there. How are you "packing" the strings before writing to file?

0 Kudos
Message 2 of 12
(4,813 Views)

It is in the "control" loop, setup load / setup save cases.

0 Kudos
Message 3 of 12
(4,809 Views)

Did you change the Params cluster?

0 Kudos
Message 4 of 12
(4,800 Views)

I didn't - but even if I did, shouldn't newly saved files load just fine, while making old files load incorrectly?

0 Kudos
Message 5 of 12
(4,795 Views)

Oh, I see the error, now. Someone was talking about VISA refs not flattening and unflattening as expected - can't find the post.

0 Kudos
Message 6 of 12
(4,794 Views)

It has to do with the data format of the strings. I'm looking at bypassing the file i/o ...

0 Kudos
Message 7 of 12
(4,792 Views)

Stepping through the controls one at a time, a boolean is the first one that works in string mode, but not in file mode. Writing to, then reading from file changes /r to /n.

0 Kudos
Message 8 of 12
(4,772 Views)

Interesting. It is a place to start in the debugging at least.

 

I've used this exact method of saving / reading data in several other programs. In fact, one of which has an almost identical setup and is still working fine. Yet in this one, I can't for the life of me figure out what is causing the problem or how to fix it - or why it would have been working last night and not today.  

 

Thanks for putting some time and effort in to it, but I give up until tomorrow 🙂

0 Kudos
Message 9 of 12
(4,768 Views)

Shameless bump in hopes that someone today can figure out what is going on!

0 Kudos
Message 10 of 12
(4,731 Views)