LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using the Connector Pane:DataType Variant Output

Solved!
Go to solution

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.

Return Variant.JPGVI scripting PN.JPG

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. Using Get Class.JPG

 

 

It's frustrating that I can see the data I want, but I cannot workout how to access it! 

 

 

0 Kudos
Message 1 of 7
(3,547 Views)

What version of LabVIEW?  LV 2015 (I think) and later have a whole palette devoted to this.

 

Capture.PNG

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 2 of 7
(3,531 Views)

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.

0 Kudos
Message 3 of 7
(3,524 Views)
Solution
Accepted by topic author McQuillan

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.

Message 4 of 7
(3,505 Views)

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.

Message 5 of 7
(3,499 Views)

@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!

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 7
(3,496 Views)
Solution
Accepted by topic author McQuillan

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).

Connector Pane Example.png

 

 

It's always nice to get to grips with a new pallet set!

Message 7 of 7
(3,490 Views)