cancel
Showing results for 
Search instead for 
Did you mean: 

LV 2012 Flatten To String / Unflatten From String problems

SOLVED
Aalenox
Member
Solved!

LV 2012 Flatten To String / Unflatten From String problems

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.

11 REPLIES 11
Todd_Lesher
Active Participant

Re: LV 2012 Flatten To String / Unflatten From String problems

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?

Aalenox
Member

Re: LV 2012 Flatten To String / Unflatten From String problems

Message contains an attachment

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

Todd_Lesher
Active Participant

Re: LV 2012 Flatten To String / Unflatten From String problems

Did you change the Params cluster?

Aalenox
Member

Re: LV 2012 Flatten To String / Unflatten From String problems

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

Todd_Lesher
Active Participant

Re: LV 2012 Flatten To String / Unflatten From String problems

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

Todd_Lesher
Active Participant

Re: LV 2012 Flatten To String / Unflatten From String problems

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

Todd_Lesher
Active Participant

Re: LV 2012 Flatten To String / Unflatten From String problems

Message contains an attachment

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.

Aalenox
Member

Re: LV 2012 Flatten To String / Unflatten From String problems

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 Smiley Happy

Aalenox
Member

Re: LV 2012 Flatten To String / Unflatten From String problems

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