PaulL Posted February 6, 2010 Report Share Posted February 6, 2010 I have the vague notion that I've seen a solution for this somewhere, but I can't find it. In any case, I think it deserves its own topic. Sometimes LabVIEW provides a Data Type code and the data Value as a variant. (In particular, this information appears in the Event Data Node for shared variable events.) With this information, one can in principle cast the data back to its original form, but the Variant To Data function does not support the Data Type code, nor does any LabVIEW function (as far as I know). This very definitely should be a native LabVIEW function (at least supporting the native types). (Otherwise, what good is the Data Type code?) Maybe LabVIEW already has this, but I haven't been able to (re)find it. Quote Link to comment
Yair Posted February 6, 2010 Report Share Posted February 6, 2010 LabVIEW doesn't have this. You need to know the data type at *edit time* because the Variant to Data primitive needs to output a wire of a specific type if you're to use it. IF memory serves, the type descriptor is used (or at least used to be) when you unflatten from a string, presumably because the flattened data does not keep all the subtleties of the data type, but I may be remembering incorrectly. Quote Link to comment
Rolf Kalbermatter Posted February 14, 2010 Report Share Posted February 14, 2010 IF memory serves, the type descriptor is used (or at least used to be) when you unflatten from a string, presumably because the flattened data does not keep all the subtleties of the data type, but I may be remembering incorrectly. Yes the flattened data only contains the actual variant part of a control and not its invariant data type information at all. The Unflatten from String did not really take a type descriptor as it also needed to know the final data type at edit time. The Flattened String to Variant does take such an input but the entire type descriptor business got internally completely redesigned with LabVIEW 8 to avoid the problem of the 16 bit size limit for old style type descriptors and NI decided at that point that they are not going to expose the new 32 bit safe type descriptors to the LabVIEW diagram in any way. The old 16 bit type descriptors are still exposed since they are used in the OpenG Variant tools and many other projects but do crash on type descriptors exceeding the 16 Bit size limit. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.