Creating global Variables

Source: Internet
Author: User

How to create a global variable. Everyone must know the difference between global variables and local variables, and if you don't understand the concept, then I'm afraid you won't be able to write a perfect, slightly larger program. In the surrounding of the software development time two or three years of college students, often find this concept unclear situation.

When we understand that a global variable is actually a variable that can be seen in every program file, it is not difficult to understand the creation of global variables. In the book I read, I introduced two ways to build global variables.

Method 1: In the back panel of a VI, select Window-->show Functions pallette-->all functions-->structures-->global. Then drag it to the back panel, Formed a blue ball with a "?" The icon, right--->open Front Panel, opens a VI. Then, create a control in the open VI that you need to create a global variable. In the back of the previous panel, right-click the control you created in the vi that you just opened.

Method 2: First file-->new from the back panel of the program ... To create a global variable, you actually select the menu after you open a VI. Here we create a control that creates global variables, and we can build many.

Next, we select Window-->show Functions pallette-->all functions-->select a VI in the program back panel. Select the vi that we just established. This creates a global variable in the back panel. But if we build multiple controls in the Global VI, we can click on this global variable and right--->select item...--> Select the global control we want to match.

If we have a good understanding, we can save some steps. You can use this method.

1. Controls that store global variables in a VI

2. What global variables are required in the program file-->new ... Create a global variable.

3. Click on this global variable, right--->select item...--> Select the control we want to create the global variable.

Creating global Variables

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.