03-12-2012 06:50 AM
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
Solved! Go to Solution.
03-12-2012 08:00 AM
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.
03-12-2012 08:03 AM
03-12-2012 08:08 AM - edited 03-12-2012 08:09 AM
03-12-2012 08:09 AM
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...
03-12-2012 08:16 AM
Sorry, my LabView version is 8.6.1. Thank you!
03-12-2012 08:17 AM
@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. Am I missing something, again?
03-12-2012 08:17 AM
@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.
03-12-2012 11:19 AM
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.
03-12-2012 11:27 AM