04-24-2013 06:15 PM - edited 04-24-2013 06:16 PM
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.
Solved! Go to Solution.
04-24-2013 06:18 PM
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?
04-24-2013 06:25 PM
It is in the "control" loop, setup load / setup save cases.
04-24-2013 06:43 PM
Did you change the Params cluster?
04-24-2013 06:53 PM
I didn't - but even if I did, shouldn't newly saved files load just fine, while making old files load incorrectly?
04-24-2013 06:54 PM
Oh, I see the error, now. Someone was talking about VISA refs not flattening and unflattening as expected - can't find the post.
04-24-2013 06:55 PM
It has to do with the data format of the strings. I'm looking at bypassing the file i/o ...
04-24-2013 07:43 PM
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.
04-24-2013 07:48 PM
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 🙂
04-25-2013 10:13 AM
Shameless bump in hopes that someone today can figure out what is going on!