LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strange Problems with Bundle, Unbundle and initializing Shift Registers...

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

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 11 of 21
(2,274 Views)

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

0 Kudos
Message 12 of 21
(2,245 Views)
(nevermind)

Message Edited by altenbach on 09-05-2007 12:15 PM

0 Kudos
Message 13 of 21
(2,245 Views)
@logic: Did you write all three versions of files? Did you read each file? If not, do the following:
1. Open all write-vis (Write_V1.vi, Write_V2.vi, WriteMostRecent.vi)
2. Open the read-vi (ReadFile.vi)
3. Enter a numeric value in Write_V1.vi and run it
4. Run ReadFile.vi -> Is the written value read at the first run of ReadFile.vi?
5. Enter a numeric as well as a text value in Write_V2.vi and run it
6. Run ReadFile.vi -> Are the numeric and the text value read at the first run of ReadFile.vi?
7. & 8. similar as 3&4 / 5&6.
 
If you did not have any problems - which LV-version do you use?
 
Simply said on my system, the written value is read at the second run of ReadFile.vi - and this is absolutely annoying.
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 14 of 21
(2,210 Views)


@altenbach wrote:
(nevermind)

Altenbach,

What did you imply ?! Smiley Indifferent

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 15 of 21
(2,199 Views)


@parthabe wrote:
What did you imply ?! Smiley Indifferent

Nothing. I just did not read the question right. 😉
0 Kudos
Message 16 of 21
(2,187 Views)

Please see the LV 8.5 bug-fixes CAR# 3E73LCFI.

Same or different?

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 17 of 21
(2,181 Views)

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

Message 18 of 21
(2,154 Views)

@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

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 19 of 21
(2,139 Views)

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

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 20 of 21
(2,094 Views)