LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scripting: Recognise get terminal pattern of VIRefNum

Solved!
Go to solution

I am accessing a typedef file (ctl) with scripting. The typedef contains control of VI Reference type (VIRefNum) with defined terminal pattern. How can I read this terminal pattern? I.e. how can I get number of terminals, connected terminals, and types of terminals?

 

There is method Set Conpane that can be invoked on VIRef wire. However, I cannot find any method (or property) for something like Get Conpane.

 

Please advice

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
0 Kudos
Message 1 of 19
(3,093 Views)

Well here is a place to start.

0 Kudos
Message 2 of 19
(3,083 Views)

Mancho00, thank you for reply.

This is not what do I ask. Probably I did not express my question in clear way. This is LabVIEW code that illustrates question:

 

190222.png

This code sets connector pane to VI refnum control (not to VI). But I need opposite action - get connector pane from VI refnum control.

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
0 Kudos
Message 3 of 19
(3,063 Views)

I see.  So what you have right now is not a VIRefNum, but a reference to a VIRefNum (a VIRefNum RefNum).  You need to dereference.  Get a VIRefNum constant (create a constant from VIRefNum input of Open VI Reference).  Get the Value Property of your VIRefNum reference and use Variant to Data to convert it to a VI type (Using the VIRefNum constant)

 

Full Disclosure: I have not tested this myself

 

VIRefNum.PNG

Edit: You may have to open a reference to VI of that type first.  Not sure if that is helpful.

0 Kudos
Message 4 of 19
(3,051 Views)

Mancho00's message gives a good clue that you need to be using a property node for Connector Pane and not a Invoke Node like you are using.  (You are not performing an action to set something, you are just trying to find out what the property is.)

 

But his VI example is too complicated.

 

This snippet gives the connector pane pattern number for the VI is runs within.

 

Example_VI_BD

0 Kudos
Message 5 of 19
(3,028 Views)

Sorry, RavensFun, I am confused. Probably this can explain my problem:

 

190223.gif

 

 I.e. connector must be obtained from control located in type def.

 

Where is my mistake?

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
0 Kudos
Message 6 of 19
(3,023 Views)

Mancho00, unfortunately your suggestion does not work because reference obtained with Variant To Data is invalid

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
0 Kudos
Message 7 of 19
(3,018 Views)

@_Y_ wrote:

Sorry, RavensFun, I am confused. Probably this can explain my problem:

 

190223.gif

 

 I.e. connector must be obtained from control located in type def.

 

Where is my mistake?


I don't understand what you are asking for.  You point to the same pattern.  You are saying you are able to set a pattern, but can't GET the pattern.

 

I showed you the property node for how to get the pattern.  My example was simplified to just point to the VI that it was running in.  You can use the script functions you already used earlier to point to another VI.

0 Kudos
Message 8 of 19
(3,007 Views)

I think the confusion here is that _Y_ has a strict VI reference control on a panel, and wants to know information about the connector pane of the VI that is defining that type. He doesn't have an actual VI that he can query for this info, he only has the VI Reference control.

 

Assuming I'm understanding the issue correctly, here's how you can get that information:

1.png

After you read the terminal data type of the VI Reference control terminal, you can use VIs from the Data Type Parsing API (LabVIEW 2015 and later) to query the VI datatype for information about its connector pane (in the 'VI Info' cluster) or the data types of the VI terminals.

0 Kudos
Message 9 of 19
(3,002 Views)

Yes, Darren, this is my question.

 

However, your suggestion launches error 1063. Seems, property Terminal.Data Type does not work here.

 

I attach test code based on your solution.  You can see the error.

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
0 Kudos
Message 10 of 19
(2,988 Views)