From the course: Learning LabVIEW

Data types - LabVIEW Tutorial

From the course: Learning LabVIEW

Start my 1-month free trial

Data types

- [Instructor] LabVIEW is a strictly typed programming language, which means all of the data elements are assigned a specific data type. Which describes the type of information they hold and how it's represented within the computer. The four most common and basic data types you'll encounter are integer numbers which can include positive and negative values. Floating-point numbers which represent fractional values and are usually shown with decimal places. Booleans which have one of two possible values, true or false. And strings which contain a sequence of letters, numbers, and other special characters to build messages. LabVIEW makes it easy to recognize which data type you're working with at a glance by color coding the block diagram components. Everything from controls and indicators shown here to block diagram wires and even constant values will be colored according to their data type. The color orange is used to represent floating-point data types. Blue represents integer data. Green is used for boolean data and pink is used to indicate strings. The text on these block diagram terminals also provides information about the specific data type. For example, the boolean says TF to indicate it will have a value of true or false and the string says ABC because it stores characters. When it comes to the numeric data types, there are several different floating-point and integer representations that can be used. The letters I32 on the integer control indicate that this is a signed 32 bit integer meaning the computer uses 32 bits to store the value and it can be a positive or negative value. If you ever want to find out more information about a data type, you can always press ctrl + h to open up the context help menu and then put your mouse over one of the objects. The context help tells me that this 32 bit signed integer is able to store values in a range of around negative two billion to positive two billion. If I move my mouse over the orange terminal that says DBL, the context help tells me that it's a double data type which uses 64 bits to store floating-point values within a really big range. You can change the specific representation of a numeric data type by right clicking on it, going to representation, and then selecting a new format. I'll choose U8. Putting my mouse back over it, the help window tells me that U8 is an unsigned eight bit integer which can hold values from zero to 255. While the data types we looked at here are some of the most common ones you'll encounter, they're just a small sample of what's available in LabVIEW. There are other numeric data types for fixed point and complex numbers, arrays, clusters, and even something called dynamic data. As you come across new data types in your programming adventures, remember that you can always use the context help window to learn more about them.

Contents