From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
02-16-2010 04:39 PM - edited 02-16-2010 04:42 PM
Hi, I'm trying to use \vi.lib\Utility\VariantDataType\GetClusterInfo.vi and it doesn't quite seem to give me what I think it should. It seems to somehow lose the data values.
PS, I tested this in 8.5 and 8.6
02-16-2010 06:00 PM - edited 02-16-2010 06:01 PM
You are correct. GetClusterInfo strips out the values. But there is a trick you can use to get the values out of a cluster to use in conjunction with this VI. Use Variant to Data to cast your cluster into an array of variants. Then each variant element of the array will correspond to a cluster element.
02-16-2010 06:13 PM
02-16-2010 06:45 PM
02-16-2010 10:05 PM
I know this is possible, but we're about at the limits of my direct knowledge on the subject.
However, this problem has been solved before by the wonderful folks behind OpenG. There's a package you can download and use (if the open source license fits your needs) that can handle all this. Specifically they have VIs such as the following that sound promising:
02-16-2010 11:10 PM
02-17-2010 01:58 AM
The OpenG package hack directly into the variant stream of the data.
Ton
02-17-2010 09:11 AM
Is there a reason why the "built in" tool strips out the data?
Can anyone comment on the reliability of the OpenG method? I'm nervous relying on it. I don't want it to test it with clusters of dbls only to have it fail on enums or something.
02-17-2010 09:17 AM - edited 02-17-2010 09:18 AM
The OpenG tools have been around for a long time, and I believe they have a pretty proven track record with noting and fixing bugs. Also, I'm pretty sure this tool has been used as the backbone for other OpenG packages, such as the variant INI configuration tools. This speaks to the level of testing it has received.
Their approach acts directly on the type descriptor information and flattened string components, rather than staying directly with variants. I would not recommend recreating this functionality. You'd likely create many more bugs than might exist in this tool! I'm of course not commenting on your skills as a developer, just on the nature of the trade 🙂
In regards to the built-in variant tools from NI, the general problem is that these were probably created to solve some problem that NI faced, and then the engineers realized they might be generally useful. But this means they might not have been designed to solve a more general user problem. Just a guess...
02-17-2010 02:06 PM