02-22-2019 12:13 PM
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
Solved! Go to Solution.
02-22-2019 12:28 PM
Well here is a place to start.
02-22-2019 01:17 PM
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:
This code sets connector pane to VI refnum control (not to VI). But I need opposite action - get connector pane from VI refnum control.
02-22-2019 02:41 PM - edited 02-22-2019 03:02 PM
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
Edit: You may have to open a reference to VI of that type first. Not sure if that is helpful.
02-22-2019 11:23 PM - edited 02-22-2019 11:24 PM
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.
02-23-2019 02:47 AM
Sorry, RavensFun, I am confused. Probably this can explain my problem:
I.e. connector must be obtained from control located in type def.
Where is my mistake?
02-23-2019 04:12 AM
Mancho00, unfortunately your suggestion does not work because reference obtained with Variant To Data is invalid
02-23-2019 11:39 AM
@_Y_ wrote:
Sorry, RavensFun, I am confused. Probably this can explain my problem:
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.
02-23-2019 03:32 PM
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:
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.
02-24-2019 03:25 AM
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.