Home  >  Blog  >   Labview

Dataflow Programming and Data Types in LabVIEW

When it comes to writing LabView programs, it's rather different from traditional coding. It employs a graphical language known as "G" instead of standard coding approaches to generate any program in block diagram form. What is Dataflow in LabView? How is it implemented in programming? And what are the LabView data types? We'll cover all of this and more in this article.

Rating: 4
  
 
7955
  1. Share:
Labview Articles

Introduction to Data Flow in labview

The LabView program development is very much different from conventional programming. Instead of using the traditional coding techniques, it uses a graphical language commonly known as “G” to create any program in block diagram form.

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.

The LabView programming works on many operating systems such as Windows, Mac OS, or Linux. 

Dataflow refers to the flow of data throughout the runtime of any program. It can also be termed as a Streaming process. Dataflow in LabView programming determines the order of execution, i.e. from right to left or from top to bottom.

Here, in this article, we are going to have a look at what is Dataflow in LabView, how it is implemented in programming, and the data types used in LabView.

Dataflow in LabView with Example:

LabView follows the dataflow model for executing programs on its platforms. Dataflow in LabView has been considered as one of the most important aspects in current IT environment. In any dataflow model, the block diagrams are referred as nodes that are connected to each other specifying the flow of data execution.

When the nodes receive all of the desired inputs, it processes the execution of the program and produces output data. This Output data is then presented to the next node in the dataflow path as input data. Figure 1 below shows an example of dataflow programming.

dataflow

Define dataflow programming and how we will implement dataflow programming in LabView with block diagram:

Here, you can work with LabView even if you didn’t know text-based languages i.e. you don’t need to worry about the semicolons or any curly braces. Moreover, as the graphical programming has a simple syntax, it allows you to focus more on the flow of data within your program. For a dataflow programming example,  we can take a look at the below-shown figure.

dataflow programming

Here a program is created to carry out the task that adds two numbers and then subtracts it from 50.00. The dataflow sequence, as you can see, executes the program from left to right in order. It also specifies that the subtraction method cannot be executed unless the addition of two numbers executes. The result of addition method acts as input for the second function. This shows that a particular node can only be executed when all the input data are available

Frequently Asked LabVIEW Interview Questions & Answers

Now, consider the below mention code segment which denotes dataflow execution of multiple programs simultaneously.

code segment

Here, as you can see the there are two programs. You cannot determine which of the function here would execute first. However, the LabView recognizes that there are no dependencies of the first task on another task. It can easily execute both functions in a multiprocessing environment simultaneously.

 MindMajix YouTube Channel

Define Data types in LabView:

Data types, as the name suggests, denotes the type of variables or data that can be used in LabView. Data types are important to remember as it helps us in determining what kind of data we have used in our program and what else we can use. In LabView, the data types cannot be interconnected i.e. if a variable is of integer type, then its value must also be the type of integer otherwise the LabView will give you an error. 

There are some unique colors assigned to different data types, which is focused on ensuring that they are not interconnected to each other. The most common data types are Integer, String, Arrays, Boolean and Float. Every data type has data stored according to its specific type i.e. integer can only store integer value and can only display integer type of data. 

Here, we are going to look at some of the most common and used data types in LabView:

Boolean: 

Boolean data types consist of only two values i.e. true and false. It is a logical data type providing the output in the form of 0 or 1 specifying false and true respectively. The Boolean data type is indicated by green data wires. LabView stores the Boolean data as 8-bit values. 

Any LED on a system acts as a Boolean indicator. For instance, in a refrigerator, the food is kept under 20 degrees. The indicator light is off unless the temperature increases.  The indicator light glow up to notify us that the temperature is more than required. This light acts as a Boolean indicator. 

Numeric:

Numeric data types in LabView are represented as floating point numbers, complex numbers, signed-unsigned integers, and fixed-point numbers. All the Integers either signed or Unsigned are indicated by blue data wires. Double and single precision and complex numbers are represented by orange data wires in LabView. The only difference in the numeric data is determined by the type of their values and the number of bits they store. 

 

numeric

Here we have showcased an example of a simple numeric integer. The floating numeric and double are also indicated in the LabView similarly. The only difference between them is the color i.e. orange, used to denote the floating and double numeric data. 

Check Out LabVIEW Tutorials

Strings:

Any sequence of displayable and non-displayable ASCII characters in the LabView data is known as Strings data type. It is indicated by Pink data wire on the block diagram. 

 

strings

Here, in the above mention figure, you can see that the string constant is indicated by the pink data wire. Some of the most common application of String data type is: 

  • Developing simple text messages for the microprocessors and display systems.
  • Instructing the users through various dialogue boxes.
  • Controlling the instruments by calling commands on the instruments.

Array:

Arrays can be distinguished as a group of specific data types. They are determined by thicker data wires. In array, we can store numeric, string, double or even Boolean data types. Given below is an example of an array constant.

array

You can create an array of any data type in two simple steps:

  • For numeric array data type, right click on the array block in the LabView system select numeric constant and drag it in the array block.

numeric array

  • Now, in order to increase the size of the array block just drag the block below as per your requirements of the elements.

array block

This will increase the size of array according to the number of elements. Moreover, to store values in the array you just need to enter the values in respective blocks.

 Cluster:

Clusters are the data type which consists different type of data in a single unit i.e. you can combine Boolean, numeric and string in a single value. This data type is indicated by thicker brown color data wire. 

clusters

Creating a cluster is similar to creating an array. You can add the cluster shell on the front panel. Furthermore, you can add the data objects by simply dragging the elements which can be numeric, Boolean or any other data types.

boolean

In the above figure, we can see the cluster containing three data types: a string, a Boolean switch, and a numeric. 

Error cluster:

Error clusters are a special type of cluster, which are used to provide warnings and error messages. Error clusters are denoted by dark yellow data wire pattern.

Error clusters are constructed from Boolean status, a string source and a numeric error code. By default, the LabView system handles errors by terminating the execution of programs and returning the section where any particular error occurred.

The error cluster has two functions i.e. Error In function – (Used to detect the error in the function) and Error out Function (Used to return the error information to the users and stop execution of the program).

 Waveform:

The waveform data type that is used to store and display periodic signal measurements i.e. the waveform creates a graph and charts of the particular data. It provides you with the exact and precise information about your data in charts and graphs form. The waveform data type is also a kind of cluster which consists of the following components:

ComponentDescription
T0This represent the time at which the function starts
dtDouble data type indicating the difference in time between each function
YThis is a 1D array containing the value of the particular function

wavefrom

Enums: 

Enums are the combination of data types mainly consisting of a pair of data values i.e. a string and a numeric value. For example, we create an Enum named as ‘Month’. The value pairs in the fields can be placed as January – 1, or February – 10 and so on. The below mention figure shows an Enum data type with month:

enum properties

Conclusion

Being a software-based application, LabView programming provides more flexibility than any other conventional techniques. Moreover, LabView programming offers you a platform-independent functionality. This simply means that you can develop a program on any operating system such as Microsoft Windows, macOS, and Linux. LabView enables you to execute programs on any other operating system as well as on Microsoft Pocket PC, Palm OS, and Microprocessors regardless on which system it is created. Furthermore, dataflow programming can execute multiple tasks simultaneously. 

The main task of LabView programming is to make your life stress-free by issuing a large number of functionalities to help with programming. All of the essential details and important information related to the dataflow programming and data types in LabView are elaborated in the above-given article. Now, it's all up to you whether to go with this high-end technology in future or not. Choose wisely and do well. All the very best!

 

Join our newsletter
inbox

Stay updated with our newsletter, packed with Tutorials, Interview Questions, How-to's, Tips & Tricks, Latest Trends & Updates, and more ➤ Straight to your inbox!

Course Schedule
NameDates
LabVIEW TrainingApr 20 to May 05View Details
LabVIEW TrainingApr 23 to May 08View Details
LabVIEW TrainingApr 27 to May 12View Details
LabVIEW TrainingApr 30 to May 15View Details
Last updated: 04 Apr 2023
About Author

Kirandeep is a Technophile & Cybernaut who loves to learn and write on various emerging technologies like Data Science, Machine Learning, Cyber Security, Artificial Intelligence, Java, SQL, Digital Marketing, and so on. When she is not writing anything, you can find her playing mobile games, cooking, or surfing about technology trends. She is a music lover! Linkedin

read more
Recommended Courses

1 / 15