Labview Programming

0 views
Skip to first unread message

Elisabet Schwartzkopf

unread,
Aug 5, 2024, 12:24:38 AM8/5/24
to isealogout
LabVIEWis a graphical programming environment that provides unique productivity accelerators for test system development, such as an intuitive approach to programming, connectivity to any instrument, and fully integrated user interfaces.

To expand on the skills you learned in LabVIEW Core 1, you can also purchase courses individually using Education Services Credits or save money taking multiple courses with a Training Membership. The following recommended courses can help you learn to do more, even faster, with LabVIEW.


You can use LabVIEW in Evaluation mode for some weeks, after that you will need a valid Serial Number. The Serial Number is provided by the LabVIEW responsible at your University/Workplace (assuming they have a valid license).


LabVIEW programs are called Virtual Instruments, or VIs, because their appearance and operation imitate physical instruments, such as oscilloscopes and multimeters.

In LabVIEW we have 2 different windows; the Front Panel and the Block Diagram. We will introduce the "G" programming Language, LabVIEW IDE, Data Flow Programming, LabVIEW Programming vs. Text-based Programming, Front Panel, Block Diagram, and Wiring in LabVIEW.


Loops allow you to repeatedly execute a specific portion of code. The different Loops and Structures available are located in the Structures sub palette in the Functions palette on the Block Diagram. The most important loops are For Loops and While Loop.


LabVIEW has powerful features for plotting your data. You can graphically visualize data in LabVIEW using two basic methods: a waveform chart and waveform graph. This module introduces a waveform graph and a waveform chart and explains when you should use them.


Case structures are some of the features you probably use most in LabVIEW. It is similar to using "If .. Else .." in text based programming languages. In LabVIEW we dont have If.. Else, so we need to use the Case Structure.


Clusters grouped data elements of mixed types, and handy to use when you want to structure your data into a manageable package. It's similar to struct or record (or a "miniature" class) used in other programming languages.


The Project Explorer lets you structure all your files that your LabVIEW Application consists of, similar to, e.g., Solution Explorer in Visual Studio. You also need to use the project Explorer if you need to create executable files, or create more advanced applications like Real-Time Applications, etc.


Debugging is the process of locating and fixing or bugs (errors) in your computer program code, in this case your LabVIEW program. LabVIEW has powerful features for Debugging your Code, such as: Broken Run Arrow, Highlight Execution, Probes and Breakpoints.


Typically engineers often create simple LabVIEW VIs that eventually grow out of control, because they don't have the proper structure and best practices. The solution to this problem is organizing your code and data in a way that enables modularity, readability, and reuse. Using a state machine approach is a good way to make it right from the early beginning.


The state machine is one of the fundamental architectures LabVIEW developers frequently use to build applications. It is reccomeded that you learn and use the LabVIEW State Machine principles when creating your applications.


To get an idea of what you can create with LabVIEW, see the following videos below. Note! These videos are presented only to get you inspired, and to see what LabVIEW is capable of. Perhaps you can get some ideas for your Delivery (see below)?


Simple LabVIEW VIs vs. LabVIEW Applications: Typically engineers often create simple LabVIEW VIs that eventually grow out of control, because they don't have the proper structure and best practices. The solution to this problem is organizing your code and data in a way that enables modularity, readability, and reuse. Using a state machine approach is a good way to make it right from the early beginning. In the LabVIEW Application Examples above, this approach has been used when developing the LabVIEW applications.


Typically engineers often create simple LabVIEW VIs that eventually grow out of control, because they don't have the proper structure and best practices. The solution to this problem is organizing your code and data in a way that enables modularity, readability, and reuse.


Create a LabVIEW Application of your own choice. It should contain basic LabVIEW features like While Loop, Case Structure, SubVIs, Arrays, Property Nodes and Clusters, etc. You should use the Project Explorer.


Use your imagination. Create something you are interested in and passionate about, in that way you learn so much more. Do it because you want to learn, not to satisfy my "requirements". Don't make the same application as everybody else in your class. Surprise me! Don't always go for the easy solution! Challenge yourself!


Submission: Document your LabVIEW Application (both GUI and code) and deliver a PDF (e.g, 5-8 pages). Here you find a Word Report Template you can use for your report. You can use another template if you prefer. Make sure you fulfill all items in this Checklist (pdf) before you deliver your Report.


The text should primarily be reflective and not descriptive. The text should not merely describe what has been done, but also why and how and what the results are. The outcome needs to be put into relevant context.


Write Technical Reports in Microsoft Word - Here you learn the basic structure of a Technical Report, how to insert Figure Captions and refer to those in the text, how to insert Equations and refer to those in the text, how to add References, etc.


Referencing: If you have used external sources, you need to use referencing. In scientific documents we typically use the IEEE standard, see Kildekompasset for details. Citation and Referencing with Microsoft Word (YouTube)


Remember to have focus on the technical work that has been done (as you have learned that technical/ professional documentation should be written), i.e., you should NOT tell how much you have learned, that the assignment was interesting and such things. Pretend that you write this documentation for a Customer that have asked you to make this program and document the Methods used and the Results achieved.




Hi I am a new LabVIEW user. I am a computer scientist and am used to text based coding and not the G programming that LabVIEW uses. So I am wondering if there is a way to type text based code into LabVIEW and if so what language(c, c++, etc.) it uses. Any help you can gve would be greatly appreciated.


I don't think this is what the OP was asking. If I am correct the OP was asking if they could actually type text based code into LabVIEW and have it execute. The answer to that is no. That would be like typing in Java code in a C program and expect it to work. There is limited capability using the formula node but that basically is used for calculations and equations.


If you are going to use LabVIEW I suggest you learn the language. It is a very powerful and capable language. In addition, once you learn the language it is, in my opinion, much more productive than text based languages. I know that I can write code MUCH faster in LabVIEW than I can in C or C++.


My degree is in Computer Science and I started my career writing code in C and then in C++. In the mid '90s I started working with LabVIEW. Given my preference I will write code in LabVIEW. It is a great language and I do believe that graphical programming will be the norm in the not too distant future. Hopefully it will be LabVIEW but regardless, I do believe that graphical programming languages will become much more prevalent.


First, see if you have to use LV. If you're more comfortable with C, that might be a better choice for you at the moment. You could also create DLLs in C and call them from LV (which is probably what the first reply points to), but that's not a very natural process in LV.


Second, assuming you continue to use it, go and read Mark's reply again, and then try to have fun. LV uses a completely different paradigm from C and some people have a very hard time wrapping their heads around it, but if you can make the transition, you'll find that LV has some very interesting computer science principals behind it and that you get all kinds of cool perks (small example - functions can have more than one return parameter, and it's completely intuitive).


Be aware that this programming style has its pitfalls, especially for someone who's already used to C, with the biggest probably being race conditions. If you run into the term "local variable", go the other way. It's an unfortunate name for something that has its uses, but can be very confusing to someone who's used to C.




You can use the mixed approach, for example you can use the formula node to "type text based code into LabVIEW" (your words). There is also Mathscript node (costs extra) that allows you to use matlab style syntax.


Think about it: The need to express your thoughts as a linear string of monochrome characters is very limiting. A graphical programming language allows to circumvent that bottleneck. LabVIEW easily allows concurrent parallel processes and is actually much closer to the generated machine code than text based code can ever be. For example, have a look at this article: NI LabVIEW Compiler: Under the Hood

3a8082e126
Reply all
Reply to author
Forward
0 new messages