LabVIEW stands for Laboratory Virtual Instrument Engineering Workbench. This tool was originally released in the year 1986 for Apple Macintosh. The programming language that is used in LabVIEW is graphical language, which is named as ‘G’. This software is predominantly used for data acquisition, industrial automation, etc.
In contrary to the general text-based programming, LabVIEW is based on graphical programming where the text-based syntax is replaced with graphical symbols and connectors.
If you would like to Enrich your career with an Android certified professional, then visit Mindmajix - A Global online training platform: “LabVIEW training” Course.This course will help you to achieve excellence in this domain.
A structure is defined as a graphical representation of a loop ( i.e., a loop is nothing but a set of code blocks that are executed based on the condition match). In reality, structures have control over the execution flow within a Virtual Instrument (VI).
There are different types of structures available within LabVIEW. We will discuss the types in detail later on in the article.
[Related Article : Customizing Graphs And Charts In Labview
To Access a structure, the developer will have to go through the following steps:
In this section of the article, we will discuss the various structures that are available within LabVIEW. The list is as follows:
Let’s understand this structure in detail by considering an example, i.e., while loop structure will be stopped after reaching a value which is equal to 50.
Follow the below steps to create a While Loop:
Click on Functions and select Structures.
Within structures, click on Random number generator icon as shown below in the screenshot.
Select the option as “Numeric” and then select “Multiply” option as shown in the screen below
Right-click and select Create> Now select the option as “Constant”. Create the constant as 100 in this case.
Now, select the option “Numeric” and then select the option “Round of to Infinity” as displayed in the below screenshot
[Related Article: LabVIEW Basics
Now, click on the option “Comparison” and then select the option “Equal."
At this point, create another constant value as 50.
Create an indicator for the output “ Round of to Infinity”
Now, join all the different blocks that we have created so far. After connecting the blocks, the entire block will look like the screen below
Now, execute the program, the while loop structure is in place and random number generator actually generates values. As soon as the random number generates 50, the while loop structure will stop generating the number.
In this case, the condition is met, so the while loop structure has successfully stopped and further it doesn't generate any number.
With the use of “wait timer” the values can be generated and seen in the LabVIEW front panel.
The wait time is actually measured in milliseconds. In this example, the wait time is about 200 milliseconds, i.e., for every 200 milliseconds, the while loop structure will generate a number.
A for loop structure is defined as a program that is executed for a designated number of times. For example, if the For loop structure is set to ‘15’ then the program will be executed for 15 times.
The following block diagram shows the set up for loop structure.
The below diagram shows the variables that we have created (i.e. Constant as N, output variable as “i”)
[Related Article: Introduction of Repetition And Loops in LabVIEW]
Once the program is executed in LabVIEW, the results will be displayed in the front panel of LabVIEW which keep on increasing till it reaches its threshold point.
In this case, the maximum limit is 14.
The output can be displayed in the front end of the LabVIEW (as shown in the below figure).
Let’s see the same below in the form diagram:
Now, execute the below logic and the output is displayed in the screen shown below.
As per the graphical representation, in order to have the calculation completed, we need to have the values available for the variable “x” and variable “y”.Once the system has both the values, then as per the sequence, the addition calculation will be executed and the output is displayed.
Within Sequence structure, we have two different subtypes available, and they are:
In a flat sequence structure, all the frames are available in the block diagram. If there are a lot of frames, then the structure may take a considerable amount of space.
In a stacked sequence structure, all the frames are in sequential order, but they are stacked on top of each other like a case structure.
Case structures are widely used in the scenarios where the program or the users have to take a decision. The decision is categorized into two options, i.e. True or False.
At any point of execution, only one condition (or case, i.e. True or False) will be executed.
The case structure functionality is explained with a block diagram below:
False condition case block diagram is shown below:
Execute the above program in LabVIEW by entering a positive value from the front end of LabVIEW and after that, enter a negative value from the front end of the LabVIEW.
In this case, the result of a true condition case structure is displayed in the front panel of LabVIEW.
The result shows a negative value within the front panel of LabVIEW.
The following are the steps to be followed to use a diagram disable structure:
step 1-Select the diagram disable structure from the structures menu.
step 2-Insert the code which you want to execute within the disable frame of the disabled structure.
step 3-To create additional frames, the developer has to right click on the border of the diagram disable structure.
step 4-Select one of the options from the shortcut menu ( as shown in the below figure).
step 5-Only one frame at a time can be enabled.
step 6-To enable a frame then the developer has to right click on the diagram disable structure and select the option “ Enable this subdiagram” from the shortcut menu ( as shown in the below figure)
In this article, we have highlighted the different types of structures that are available within LabVIEW for the developer to utilize based on the requirements. Unlike any other software tool, LabVIEW provides features and facilities where the developers can execute the code according to the ad-hoc needs. So, using structures has definitely reduced the burden for developers.
Stay updated with our newsletter, packed with Tutorials, Interview Questions, How-to's, Tips & Tricks, Latest Trends & Updates, and more ➤ Straight to your inbox!
|LabVIEW Training||Oct 07 to Oct 22||View Details|
|LabVIEW Training||Oct 10 to Oct 25||View Details|
|LabVIEW Training||Oct 14 to Oct 29||View Details|
|LabVIEW Training||Oct 17 to Nov 01||View Details|
I am Ruchitha, working as a content writer for MindMajix technologies. My writings focus on the latest technical software, tutorials, and innovations. I am also into research about AI and Neuromarketing. I am a media post-graduate from BCU – Birmingham, UK. Before, my writings focused on business articles on digital marketing and social media. You can connect with me on LinkedIn.
Copyright © 2013 - 2023 MindMajix Technologies