LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Know programmatically if a control is a typedef

Solved!
Go to solution

I want to know programatically if a control on the front panel is a typedef, and in case it is I would like to know the path or at least the name of its *.ctl file. LabView knows it is vinculated to the type definition, but I cannot find the property where can be checked programmatically.

Many thanks,

David

0 Kudos
Message 1 of 11
(3,559 Views)

You did not indicate which version of LabVIEW you are using. In LabVIEW 2011 you can turn on scripting functions (Tools -> Options -> VI Server). When you do this you will find that the "Is Typedef?" property will be available.

0 Kudos
Message 2 of 11
(3,545 Views)

What he said ^^^^^.   Like this:

typedef.png  Example_VI_BD.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 3 of 11
(3,542 Views)

Edit: Post removed, I was beaten to it Smiley Very Happy

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 4 of 11
(3,538 Views)

Scripting will do it but only in the development environment. If for some reason you need something that will work in an executable, you can get to it converting the control into a variant, flattening the variant to a string and then searching for ".ctl" in the string. If it's a typedef, its name is in the variant data - hence the ,ctl.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 5 of 11
(3,535 Views)

Sorry, my LabView version is 8.6.1. Thank you!

0 Kudos
Message 6 of 11
(3,525 Views)

@mikeporter wrote:

Scripting will do it but only in the development environment. [...]




I build a quick executable in LabVIEW 8.6 and the scripting node worked.  Smiley Surprised  Am I missing something, again?

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 7 of 11
(3,523 Views)

@mikeporter wrote:

Scripting will do it but only in the development environment.


Actually, this particular function is still available in the Runtime, but only as a read-only. The poster didn't indicate what they were doing with it, but the post seemed to imply he just wants to know if it's a typedef.

0 Kudos
Message 8 of 11
(3,522 Views)

I cannot access to the VI scripting funcions in LabView 8.6.1, and the solution using the variant option needs to wire directly the control, but it doesn't work using only the references to the control (which actually is the only thing I have). My target is to create a SubVI that programatically document the code developed using the tools provided in LabView, and I considered interesting to mention which controls are typedefs. Anyway it is not very important, so I'm thinking that maybe I can leave the typedef information unfilled until I change to a newer version.

Thank you to all of you.

0 Kudos
Message 9 of 11
(3,498 Views)
Hmmm... always something new to try. Ni has always said scripting things are only available in development -- so I never tried!

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 10 of 11
(3,496 Views)