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.
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?
It is in the "control" loop, setup load / setup save cases.
Did you change the Params cluster?
I didn't - but even if I did, shouldn't newly saved files load just fine, while making old files load incorrectly?
Oh, I see the error, now. Someone was talking about VISA refs not flattening and unflattening as expected - can't find the post.
It has to do with the data format of the strings. I'm looking at bypassing the file i/o ...
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.
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 ![]()
Shameless bump in hopes that someone today can figure out what is going on!