04-10-2019 09:02 AM
Using the DAQmx Counter - Read Pulse Duty Cycle and Frequency example, the data is stored in a variant with both duty cycle and frequency. If you want to separate the two values so they are each an independent array, how do you accomplish that? I've tried indexing the array, which only removes a single pair of values, and not one of the sets. Then, I though to use get variant attribute, but that didn't work either.
Solved! Go to Solution.
04-10-2019 09:18 AM - edited 04-10-2019 09:19 AM
The example VI I'm looking at doesn't have a variant. It has an array of clusters. Each cluster has the duty cycle and frequency. So you just need to index and unbundle.
04-10-2019 09:25 AM
It depends on how the data is stored, but I'm guessing it is the Variant to Data you are looking for. You specify the data type of the variant and then the output is the data in that format. Of course this only works if the data type is correct and if it is wrong it will generate an error. It is odd to me that this function doesn't just return the data in the native data type.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
04-10-2019 09:29 AM
Ah that is what it is then. My first thought was that it was a cluster, but I didn't index them first when I tried to unbundle, and so got an error on the wire. Thanks.
04-10-2019 09:32 AM
Just hover over the wire or the terminal with context help turned on, or look at the indicator on the front panel and it will et you know how the data is structured.