How to Programmatically Center Indicators on the Front Panel Primary Software: LabVIEW Development Systems>>Professional Development SystemPrimary Software Version: 8.2.1 Primary Software Fixed Version: N/A Secondary Software: Utility Software>>Instrument I/O Assistant
Problem: How can I programmatically center an indicator in the front panel of LabVIEW? Solution: A Panel Bounds property node can be used to calculate the width and height of the front panel. To obtain this property: 1. Place a property node on the block diagram. 2. Right click on the half of the property node and click on Select Class » VI Server » VI » VI. 3. Left click on the bottom half and select Front Panel Window » Panel Bounds. 4. Wire the output to an Unbundle by Name vi, and the result should look like the figure below. These four unbundled values can be used to calculate the width and height of the front panel. Using the bounds of an indicator, the position to center the indicator can be calculated and updated while the program is running. For example, consider centering a waveform graph in the figure below. When this code is placed into a loop, the indicator will dynamically center itself on the front panel. The attached VI demonstrates this. Run this VI and resize the front panel while it is running.
Related Links: Attachments:
Report Date: 06/06/2007 Last Updated: 06/26/2007 Document ID: 4A5JUPCY |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
