07-24-2015 02:44 AM
Hello all,
In an application, I have a worker thread which is basically writes to log file with datalog function. This thread stores datalog refnum in one of its shift registers. I will be using this worker thread (instances) to write different types of cluster data.
To open datalog file, I need to specifiy data type and I can't figure out how to do this. Putting types in Case structure doesn't work because the tunnel can only take one type wired to it. Putting types and Datalog open function in case structure doesn't work either because Datalog refnum is not a simple refum as it contains type specifics. So again the problem with tunnel type.
The only way I can get around this is writing flattened string to datalog file. This way the datalog function is typed as string. The draw back with this method is the possibility of data corruption when Labview version changes ( which may change flattened to string implementation)
Can you offer some suggestions ?
07-24-2015 02:53 AM - edited 07-24-2015 02:55 AM
Hi zigbee,
The draw back with this method is the possibility of data corruption when Labview version changes ( which may change flattened to string implementation)
When NI changes internal representation of datatypes it will not only change the output of FlattenToString, but also the datalog format! So there is no difference between a "pure" datalog file and a file using flattened strings…
(I had this problem once somewhen between LV3 and LV6 - and never used datalog files again.)
When you want to handle your problem an OOP approach might work: you can have several objects of the same class working with with different data clusters (or use parent and child classes)…
07-24-2015 03:06 AM
Hi GerdW,
Thanks for your extremely quick reply and good info on datalog file format. so OOP is the only solution to the problem ?
And writing flattened string vs writing variant to datalog, which one sounds better in your opinion ? (speed, etc...)