LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scripting: Recognise get terminal pattern of VIRefNum

Solved!
Go to solution

The terminal solution only works if the control has a terminal, which the control on the panel of a .ctl will not. Try using the Value property instead of the Terminal.Data Type property.

Message 11 of 19
(1,231 Views)

Yes, Darren, reading Value property does not return any error. However, I cannot find how to use obtained value Variant.

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

@_Y_ wrote:

However, I cannot find how to use obtained value Variant.


I don't understand your question.

0 Kudos
Message 13 of 19
(1,195 Views)

I can read Value but cannot use it for obtaining any information about terminals.

 

This is illustration of my attempts; both branches launch errors in last steps:

 

example190227.png

 

 

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

Look at my previous screenshot...you can get an array of the terminal data types from the Get VI Information VI.

0 Kudos
Message 15 of 19
(1,184 Views)

Sorry, I tested it first and forgot to present in the message. It returns number of terminals but not their types:

 

example190227-2.png

 

 

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

Seems I have solved the problem just now. But my hack is really ugly.

 

The script creates dummy VI, adds a Call By Reference node in its BD, connects the node to the type-defined input, and reads terminals of the Call By Reference node:

 

ugly_solution_190227.png

 

It works... but I'm not happy with such ugly things. Probably there is a better way.

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
0 Kudos
Message 17 of 19
(1,176 Views)
Solution
Accepted by topic author _Y_

The VI you're using in the For Loop should be Get Type Information.vi, not Get VI Information.vi. When you use the proper VI in the For Loop, you'll get the type info you're looking for.

 

1.png

Message 18 of 19
(1,175 Views)

Yes, Darren, this was my mistake. Sorry. I placed wrong VI in BD and considered solution as non-functional.

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