Virus scan in progress. Please wait to download attachments.
Overview This example demonstrates how to retrieve the data type of all front panel objects through the use of VI Server, Property Nodes & Scripting Property Nodes.
Description LabVIEW has no direct way for determining the data types of the objects on the Front Panel, this example scans through the Front Panel Objects and returns their datatype to an output array. The output array is ordered based on the control index of the Front Panel Object.
It does this by analyzing the general class name for the object, and then determining whether further evaluation is required. For e.g. an object with the class name of Boolean could be put straight into the array; However an object with the class name of Array would require further investigation to determine the representation of the elements in the array.
For determining the exact type of numeric/refnum/cluster etc., a variety of Scripting property nodes, standard property nodes and lookup tables are used where required.
While most data types are relatively straight forward to determine through this method of searching for representations or checking lookup tables, it is worth noting that clusters require a recursive method due to the ability to place clusters within clusters.
All of the code is documented; However if anything is unclear (or errors are spotted), feel free to comment and I'll be happy to discuss it further.
LabVIEW 2012 (or compatible)
Steps to Implement or Execute Code
Download and extract the attached Zip File
Open the "Get Front Panel Object Types" project from the Front Panel Object Types Folder
Open "Get Front Panel Object Types 2012 NIVerified.vi"
Run the VI
The VI will launch a file browser dialog, select the VI of your choice, or select the example front panel included in the project "Test Front Panel.vi"
The code will run and populate the array with the Front Panel Object Types. These can be compared to the selected VI, remembering that the array is populated based on the index of the front panel control.
Additional Information or References
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.