09-05-2007 06:19 AM
Hi all
I just ran into troubles with the bundle by name function and I thinks this problem could be discussed here.
Firstly I want to give you some background information: I generally use xml-files to store configuration data. The data is defined via strict type def. Now, if this definition changes, I lose the existing filecontent, as the xml-definition of the type to read and the xml-definition of the data in the file does not match anymore. To solve this, I chose the following approach: in a while loop I placed a case-structure which is controled by the iteration counter of the loop. In case zero (which is also the default case) I try to unflatten the data of the file to the most recent structure. If this does not work, the vi goes into case one, where I try to unflatten to the previous version and so on. If the read data is of an older definition, I use the unbundle by name to get the values and use a bundle by name to fill them into the new structure.
I thought this was a good solution, but obviously it is not. I found out, that it does not bundle the data correctly. The reading is ok and so does the unbundle by name, but after the bundle by name I still have either the old values or the default values, until I read a second time.
Attached are some vis, which show this behaviour. Use the Write*-vis to write a datafile, containing data defined by one of the three type-defs. After writing the datafile, you can use the ReadFile.vi to read the data.
Do you also encounter this problem? If so, what causes this problem? And most important - how can I solve it?
Thomas
09-05-2007 02:05 PM
Hi,
I don't see any problem in your VI. It works the way it suppose to work. It will give the default values ( From the constant cluster you wired to bundle by name) for the values you are not bundling. Or i am missing something in your question.
Thanks,
logic
09-05-2007 02:11 PM - edited 09-05-2007 02:11 PM
09-17-2007 01:47 AM
09-17-2007 06:33 AM
09-17-2007 10:15 AM
09-17-2007 10:25 AM
Please see the LV 8.5 bug-fixes CAR# 3E73LCFI.
Same or different?
Ben
09-17-2007 05:11 PM
Hi Becktho,
Yes. I got the same behaviour in LV8.0. I wrote the earlier post after testing with LV8.2. So FYI, in LV8.2 it is working well. It should be in 8.5 also.
I guess, it is a bug in LV8.0, you can avoid this by replacing that tunnel by a shift register. I am not sure, what causes this bug; it could be related to the memory allocation for bundling clusters, we need a NI guy to explain that.
I hope it gives a solution for now. Happy coding.
Thanks,
logic
09-18-2007 12:01 AM - edited 09-18-2007 12:01 AM
@Ben: No, it's not the same. I do not have clusters in clusters
@logic: What is interesting, is that it works, if I bundle the data outside the case-structure:

So I will use the method I tried in the upper loop. Although I have a solution, I still don't understand the different behaviour.
Message Edited by becktho on 09-18-2007 07:04 AM
09-18-2007 08:34 AM
I posted this to the Bug Thread.
It looks like it was fixed in LV 8.2 (?) but for the record I included it in our Bug Threads.
Ben