Example Code

Moving an Object on the Front Panel Programmatically

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

Program that shows how to move a control programmatically through the Front Panel using the Position property of VI Server.

 

Description

This code consists of moving a button control through a particular area by setting the proper coordinates selected by the user. If the user specifies a coordinate value outside of the allowed bounds, the button will be moved to the respective initial value (for the horizontal value is 252, and for the vertical value is 72). The maximum coordinate allowed is (528,352).

 

Requirements

LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code
1. Open the "Move Control Programmatically LV2012 NI Verified.vi".
2. Select the Run button.
3. Use the Horizontal and Vertical controls to set the coordinates in which you would like to have the button on.

 

Additional Information or References

Capture.PNG

Chris Van Horn
Applications Engineer

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.