LabVIEW Structures | Execution structures in Labview


Structures in LabVIEW

The structures in LabVIEW contain sections of graphical code. They control and determine when and how the code should be run in a virtual instrument (VI). A structure can be referred to as a graphical representation of a loop. It helps in iterating a piece of code as many times as we want.

   Wish to make a career in the world of Labview? Start with Labview Training !

How to access structures in LabVIEW?

Open LabVIEW, and open the Front Panel. Click on the ‘View’ option from the top menu and select ‘Functions’. Choose the ‘Programming’ option and click on the ‘Structures’ icon. You will get a list of all the structures of LabVIEW. To use a structure, drag and drop them on to the block diagram. 

Structure in Lab view

Types of structures in LabVIEW

LabVIEW offers different kinds of structures that serve different purposes. Here is the list of structures that are available in LabVIEW.

  • While Loop structure
  • For Loop structure
  • Sequence structure
  • Flat sequence structure
  • Stacked sequence structure
  • Event structure
  • Timed structure
  • Diagram disable structure
  • Conditional disable structure

Let’s discuss in detail each of these structures and how to implement them.

While Loop structure

The While loop structure continues to execute a programme until a stop condition is met. When a STOP button is clicked, the while loop structure is used to keep the application continuing. Until the created value equals 50 or the STOP condition is met, and the while loop structure continues to execute and generate new values.

  • While loop is created as follows:

Structure in Lab view

  • Now Create a random number generator.

Create a random number

  • As shown below, Create a multiply sign.

Create a multiply sign

  • Now Create a constant 100.

Create a constant 100

  • As shown below, Create a “round of to -infinity”

round of to infinity

  • As shown below, Create a “Equal to”

Equal

  • As before, create the constant 50.
  • Create an indication for the “round of to – infinity” output as

round of to - infinity

  • As shown below, now Wire the blocks

Wire the blocks

  • Once the random number generator creates the value 50, run the application to view the results. Now the while loop should stop generating new values.

generating new values

  • You can view values being produced on LABVIEW’s “front panel” by using the “wait timer” that has been involved. This value is measured in milliseconds. There are 200 milliseconds here. There is a 200 seconds delay added between loop iterations.

For Loop structure

Using a for loop structure, the programme is repeated a specified number of times. N is the count terminal in the For loop, and “i” is the iteration terminal. Each time the loop runs, the value of “i” shifts from 0 to N-1.

  • Just as we did with the while loop, create the for loop.
  • Create a constant using input of N.
  • Make an indicator of i’s output.
  • A “wait” timer should be created as in a while loop.

Loop structure

  • Use LabVIEW to run the program. On LabVIEW’s front panel, you can see that the “current value” keeps rising. Till it reaches N-1, although this is 14 in this example.
  • The following is another way to store the values of “i” in an array.
  • Outside of the for loop, a create indicator for the output of “i.”

create indicator for the output

  • Execute the LabVIEW program. As soon as the program ends, all the values will be displayed in an array on LabVIEW’s front panel.

LabVIEW program

  • Graphs may also be created using arrays. Draw a block diagram similar to the below one. By navigating to the search bar and typing the names of the blocks that are shown on top of the blocks, such as “pi,” you may determine all the blocks.

block diagram

  • Execute the LabVIEW program and look at the graph displayed on Labview front panel.

Labview front panel

 

A For loop might not execute sometimes in a VI when the condition is not met. We can change a While loop to a For loop. To do so, right-click on the border of the While loop and select the ‘Replace with For Loop’ option from the shortcut menu.

Sequence structure

A sequence structure is utilized whenever we need a program to run in a sequential manner. The order of execution is not always under your control in LabVIEW. When a subsequent computation depends on a prior one, we are confident that it will happen in the proper sequence. However, we will not be able to control the sequence of calculations when they are being done in parallel. Calculations are compelled to occur in a predetermined sequence using a sequence structure.

Sequence structure

  • Execute the program and you would see the result as below.

Resukt

  • The two random numbers are generated by this programme in four seconds, after which their sum is shown in two seconds.
  • The Flat Sequence structure was applied in this example. When there are numerous frames, the Flat Sequence structure may consume a lot of room while still displaying all the frames (steps) in block diagram. The Stacked Sequence structure is an alternative. The frames are still sequential in the stacked sequence structure, however they are stacked one on the other. We choose the displayed frame using the Selector Label.

Labview Training

  • Master Your Craft
  • Lifetime LMS & Faculty Access
  • 24/7 online expert support
  • Real-world & Project Based Learning

Flat sequence structure

In the flat sequence structure, the block diagram contains all of the frames. The structure could require a huge amount of space if there are many frames.

A flat structure is very flexible. When a frame is added or deleted, it will resize automatically. We can change a flat sequence to a stacked sequence. If we do that, all the input terminals of the frames will be moved to the first frame of the stacked sequence. When we change the stacked sequence to a flat sequence, we have to move the wires of the first frame to their original locations, i.e., individual frames.

Top 30 labview interview questions and answers for 2020!

Stacked sequence structure

All of the frames in a stacked sequence structure are arranged sequentially but are layered on top of one another, much like a case structure.

Case structures are more commonly employed in the scenarios when the user or the program need to make a decision. These decisions are classified into two options: either true or false. 

Whenever executed, just one condition will be executed i.e., true or false.

The following block diagram explains the functionalities of the case structure:

  • Initially, draw the scenarios with a true value and a false value.
  • This option is available in the case structure’s main menu in LabVIEW.
  • Now we will calculate the log value and we need the case structure to only look for positive values.

Following is the true condition case block diagram. From the LabVIEW front end, the user will have the ability to enter a value in “X.” (that can be viewed on the block diagram’s left-hand side).

Stacked sequence structure

Following is the case block diagram for False condition:

block diagram for False condition

In LabVIEW, run the above program entering the positive value from LabVIEW’s front end and then a negative value is entered from LabVIEW’s front end.

In this case, a true condition case structure result is shown in the LabVIEW front panel.

LabVIEW front panel

Then a negative value is displayed as a result within the LabVIEW’s front panel.

negative value

Event structure

  • The event structure handles an event in accordance with its occurrence.
  • When a particular collection of events is triggered, the event structure will run and handle that specific event as necessary.
  • Sub-diagrams or event cases in an event structure are generally responsible for carrying out the events that are intended to be handled.
Programming & Frameworks, labview-structures-description-17, Programming & Frameworks, labview-structures-description-22

Subscribe to our YouTube channel to get new updates..!

Timed structure

  • One or more sub diagrams/frames available in a time structure that are executed by an internal/external timing source.
  • Executions take place in a sequential order. Each frame is executed  only during the execution process.

Diagram disable structure

  • A diagram disabled structure can be used to execute a certain piece of code in LabVIEW if the developer wants to do so.
  • The developer will be able to run a specific part of the code and evaluate the outcomes by using this structure.
  • Conversely, conditional disable structures can be used to do this if the developer wishes to run a specific part of code only under certain circumstances.

The steps to use a diagram disable structure are as follows:

Step 1: From the structures menu, choose the diagram disabled structure.

step 2: Place the code that you wish to run inside the disabled structure’s disable frame.

Step 3: The developer must do a right-click on the diagram’s border to disable the structure for adding more frames.

step 4: choose an option from the shortcut menu.

Step 4 shortcut menu

step 5-Only one frame at a time can be enabled.

step 6-To enable a frame then the developer need to right click on the disable structure diagram and choose the option “ Enable this subdiagram” from the shortcut menu (as shown below)

step%206%20Shotcutframe

step 7: A single frame can only be activated at a time.

step 8: The developer must right-click on the diagram’s disabled structure and choose “Enable this subdiagram” from the shortcut menu in order to enable the frame.

Conditional disable structure

When we have some subdiagrams to execute depending on a condition, we can use a conditional disable structure. We can disable a subdiagram on the block diagram, so it executes based on a user-defined condition. Place a conditional disable structure on the block diagram, and add a subdiagram to it. Right-click on the border of the structure and select the ‘Edit Condition For This Subdiagram’ option.

We will get a configure condition dialog box where we can configure conditions. It also provides pre-defined symbols to configure conditions. We will have a selector label to scroll through the available subdiagrams in the structure. When we delete the structure, the subdiagrams won’t get deleted.

Labview Training

Weekday / Weekend Batches

Conclusion

In this post, we have explained in detail about all the structures in LabVIEW. Using structures will make the programming easy for developers. LabVIEW has introduced them, so the developers can execute the subdiagrams according to their needs. Try out different structures in the development of VI in LabVIEW.

Related Articles:



Source link

Leave a Reply

Subscribe to Our Newsletter

Get our latest articles delivered straight to your inbox. No spam, we promise.

Recent Reviews


Informatica Architecture:

The architecture of Informatica is service-oriented (SOA). A service-oriented architecture is a collection of services which interact with one another. It could be a basic data transfer or two or even more services coordinating the same action throughout this interaction.

Informatica growth is dependent on component-based development techniques. To achieve the desired result, this technique employs predefined components and functional departments with their associated functionalities.

Become a Informatica Certified professional by learning this HKR Informatica Online Training !

PowerCenter is built using element methodology. The process of constructing a dataflow from source to target involves the use of various components, which is known as transformation.The Informatica ETL tool includes the following services and components:

Informatica Architecture

  • Repository Service: This service is in charge of keeping Informatica metadata and providing access to that to other services.
  • Integration Service: This service facilitates the transfer of data from sources to targets.
  • Reporting Service: This service is in charge of producing reports.
  • Nodes: This is really a software device used to carry out the aforementioned services.
  • Informatica Designer: It is responsible for creating mappings between source and target.
  • Workflow Manager: It’s being used to generate workflows as well as other tasks, as well as to execute them.
  • Workflow Monitor: It’s being used to keep track of how workflows are being executed.
  • Repository Manager: This application is used to handle the objects inside the repository.

Informatica ODBC

Informatica Certification Training

  • Master Your Craft
  • Lifetime LMS & Faculty Access
  • 24/7 online expert support
  • Real-world & Project Based Learning

Informatica Domain:

Informatica Domain

  • The Informatica domain serves as the primary administrative division.
  • Informatica is made up of nodes and services. Premised on administration requirements and design architecture, these nodes and services are organised into folders or subfolders.
  • The Informatica administrator’s Console web page creates a domain that resembles a folder. We could indeed generate a node with the services inside this folder.
  • A node is a logical depiction of a machine in the Informatica domain. In Informatica, all services and processes run within the domain. A single domain can contain multiple nodes. A gateway node receives client requests and routes them to the appropriate service.
  • The domain offers two types of services, including:
  • It handles domain operations including such logging, authentication, and authorization. It manages users and groups and runs the application services on the nodes.
  • Application Services: These are server-specific services like repository services, reporting services, as well as integration services. Depending on the configuration, the application service can run on multiple nodes.

Node:A node seems to be a reasonable analysis of a machine in a domain, and a domain has various hubs. We could indeed create hubs, such as mix administration, to run application administrations.

PowerCenter Repository:A relational database, such as SQL Server, Oracle, or Sybase, serves as the PowerCenter repository. And the repository services are in charge of maintaining these databases. The metadata is stored in the database tables.


Informatica client tools are classified into three types:

  • Informatica designer
  • Workflow manager for Informatica
  • Informatica workflow supervisor

Informatica is often used to handle the repository and provides repository services. The repository services only handle one request per repository. However, we can run it on multiple nodes to improve performance.

Because of its version control mechanism, we can keep different versions of the same objects. Also, disregard multiple users who are modifying the same object at the same time.This three-state is present in the objects created in the repository, such as:

  • As per Informatica, valid objects have the correct syntax. And it is used to carry out the workflow.
  • Invalid objects do not adhere to the standard or rules. During the object’s save in Informatica, these objects checked whether the syntax and properties were valid or not.
  • Affected: The affected object’s child objects are invalid.
HKR Trainings Logo

Subscribe to our YouTube channel to get new updates..!

PowerCenter Repository Service:

The PowerCenter repository service is a separate multi-step process. It enables customers to modify the metadata in the store. It accepts metadata requests from the respectful benefit in order to run work processes.

And the repository service keeps PowerCenter customers’ connections to the PowerCenter vault up to date. It inserts the metadata into the archive and keeps it up to date. It can maintain consistency within the archive metadata.

Domain Configuration:

The domain is a necessary fundamental administrative control in the Informatica ETL tool. It is a visible entity that offers a variety of services such as repository service, integration service, and various nodes. The Informatica admin console is used to configure the domain. In addition, web browsers are used to launch the console.

Connectivity of the PowerCenter Client and Server:

Client-side machines have PowerCenter client tools installed. Workflow manager, PowerCenter designer, repository manager, and workflow monitor are examples of development tools.

All mapping as well as objects created in these client tools are stored in the Informatica repository, which is located on the Informatica server. As a result, client tools must be network-connected to the server.

In addition, the PowerCenter client connects to the sources and targets in order to import metadata and structure definitions. As a result, it maintains connectivity to the source or target systems.

  • TCP/IP protocols are used by the PowerCenter client to connect to the integration and repository services.
  • And the PowerCenter client connects to the source or target using ODBC drivers.

Top 30 frequently asked Informatica Interview Questions !

Repository Service:

The repository service runs in multiple threads. It keeps the PowerCenter clients and the PowerCenter repository connected.The repository service has access to the repository’s metadata and can retrieve, insert, and update it. It also ensures consistency within the repository metadata.

Integration Service:

In Informatica, the integration service serves as an execution engine. It aids in the execution of tasks created in Informatica. The integration service operates in the following ways:

  • A workflow is carried out by a user.
  • Informatica directs the integration service to carry out the workflow.
  • The integration service then retrieves workflow details from the repository.
  • The integration service initiates the execution of the tasks contained within the workflow.
  • Following implementation, the task condition is modified, such as Succeeded, Failed, or Aborted.
  • The session log as well as workflow log are then granted.
  • This service transfers data from the source systems to the target systems.
  • The integration service combines information from diverse sources.

Informatica Certification Training

Weekday / Weekend Batches

Conclusion:

In the above blog post we had discussed informatica, informatica architecture in depth. Had any doubts stop your queries in the comments section to get them resolved. Happy learning!

Related Articles:



Source link