To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This example demonstrates determining which element of an array was clicked and returning that value.
Description
An event structure is used to detect a mouse click. Using the control reference provided by the event structure, there are two methods to extract the value of the element clicked for the generic array. The first method uses the To More Specific Class function. You will need to provide the Target Class constant to match the data type of the array. This will produce the proper reference to provide to a property node for the value. The second method uses the Variant to Data function to convert the value into the proper data type. For the Boolean array, the value change can be detected with the Event Structure. The changed value and the index of the changed element is determined by comparing the previous and current arrays.
Requirements
Steps to Implement or Execute Code
Additional Information or References
Front Panel
Block Diagram
**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.