09-13-2018 12:49 PM
I want to get the data type and input parameter of the connected terminals of the connector pane.
Using the ConPane.DataType returns a variant containing all the data I want, but I do not know how to parse it to get the constituent parts.
From the front panel I can see that index 0 contains an array of U32s and that it's a recommended input. My question is, how do I extract this data?
I did try this approach (below) but it strips a lot of the data that I want.
It's frustrating that I can see the data I want, but I cannot workout how to access it!
Solved! Go to Solution.
09-13-2018 02:00 PM
What version of LabVIEW? LV 2015 (I think) and later have a whole palette devoted to this.
09-13-2018 02:24 PM
I was playing around with that pallet for a little while as I thought that's where the answer would lie, but I couldn't get anything meaningful out.
09-13-2018 05:39 PM
If you run the Variant output of ConPane.DataType into "Get VI information" from the palette above, one of the outputs is an array of Variants, one each per terminal. Run that through a FOR loop and inside the loop run each instance into the "Get type information" from the very same palette.
That gives you an enum output which gives you the data type. For data types like array, cluster, etc. where you need more information, run the variant through the appropriately named VI that extracts more information from them.
09-13-2018 05:59 PM
Cheers Kyle,
That's exactly what I ended up doing. It took me a little while to realise I needed that I needed the Get VI Information VI, but once I got that, the rest was quite straightforward.
09-13-2018 06:02 PM
@McQuillan wrote:
Cheers Kyle,
That's exactly what I ended up doing. It took me a little while to realise I needed that I needed the Get VI Information VI, but once I got that, the rest was quite straightforward.
Give yourself a little more credit than that. It's not that straightforward!
09-13-2018 06:29 PM - edited 09-13-2018 06:34 PM
Aha, nice of you to say!
I've uploaded a quick example just to help out anyone else struggling with the same thing. It's no way near exhaustive (for example, I didn't include recursive cluster or array checking).
It's always nice to get to grips with a new pallet set!