LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Community Nugget 06/25/2007

JLV asked;
 
"Isn't that complicating somthing that's supposed to make life easier (to maintain/scale)?"
 
The issue is the format of the data in the data log file. When a cluster is written to a datalog file, the cluster (I beileve) is first flattened to a string. Wehn it read, the Unflatten from string is used to convert the flattened datalog file using the "Type" of the datalog file. If a file written to disk with one definition of the cluster and at a latter time it is read back using a different cluster type, the unflatten from string fails.
 
Editing the type def does not update all of the files that were written to disk.
 
But Jarods commnets indicate that the classes do not suffer from this limitation, I think.
 
Ben
 
 
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 31 of 51
(4,421 Views)
hummm... that's good to know....
Message 32 of 51
(4,417 Views)


@Ben wrote:
 
But Jarods commnets indicate that the classes do not suffer from this limitation, I think.
 
Ben
 


Yes, classes were specifically designed to overcome this limitation in regular typedefs.
Jarrod S.
National Instruments
Message 33 of 51
(4,409 Views)
"Yes, classes were specifically designed to overcome this limitation in regular typedefs"

Holy Bits and Bytes Batman!

How does a "new" class know what to convert from?  Is the relevant information saved with the flattened class?  Does this cause much overhead?

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
Message 34 of 51
(4,368 Views)

Shane,

I hate to say this.... "Robin, I think you just opened up another can o' worms..."

😄

 

Message 35 of 51
(4,351 Views)
I have never studied classes, but I think it is similar to the Init of an XControl.

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 36 of 51
(4,342 Views)
Here is my personal guess, since I don't work on LVOOP 😞

There shouldn't be but a very small and constant amount of overhead involved in this process. You will note that LVClasses have a version number associated with them (major, minor, fix and build). The build number will automatically increment as you make changes to the class data. I think this version number gets saved with the flattened data. Then when you unflatten the class again, LabVIEW knows if the saved data's version is older than the expected class' version. If so, translation occurs.

Some form of translation code has been around LV for a while. For instance, create a plain old typedef with two numeric controls. Create an instance of that control and assign non-zero default values to the controls. Now go back to the typedef and add a third control inbetween the first two, or change one of the control's names. Go back to the instance you created of your control and notice that the data is still pretty much intact for the first two controls you created. LabVIEW knows to some extent how to retain data in changing datatypes. The problem was that typedefs didn't have versions associated with them, they were just data. So flattening them to string lost any notion of how this translation should take place later when unflattening an older version.

This algorithm may have been updated since then to apply in some new way for classes, or perhaps not. But I would bet that's the mechanism involved.

Message Edited by Jarrod S. on 06-28-2007 10:12 AM

Jarrod S.
National Instruments
Message 37 of 51
(4,335 Views)

Jarrod,

Are you allowed to write Nuggets?

I'd love to see a Nugget that compares the datalog method to the LVOOP version.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 38 of 51
(4,324 Views)
I'm certainly allowed. That's a great suggestion. I'll see what I can do!
Jarrod S.
National Instruments
Message 39 of 51
(4,320 Views)
For anyone interested, there's a shipping example that demonstrates the automatic data mutation that ships with LabVIEW. I have 8.2.1 installed, so I'm not 100% sure if it ships with 8.2. In any case it has everything you will need already built up with instructions to show you the process.

You can get to it via the Example Finder under Fundamentals >> Object Oriented >> Read Write Class Data to File.
Jarrod S.
National Instruments
Message 40 of 51
(4,298 Views)