09-06-2011 06:15 PM
I have created VIs using LabVIEW's express VI development toolkit, but how are the simple VIs created in the first place? I remember reading somewhere that LabVIEW has its foundation in C++. So is it true that a bunch of C++ code can be compiled into a macro that we call the LabVIEW VI block? What is the most fundamental level at which one can tweak around in LabVIEW?
09-06-2011 06:58 PM
09-06-2011 06:59 PM
You cannot compile C++ code into a LabVIEW primitive, but you can build your C++ code into a DLL and call that from LabVIEW. Older versions of LabVIEW support "Code Interface Nodes" (CINs) but those are now deprecated in favor of DLL calls. If you link your C++ DLL against LabVIEW, you can call functions built into LabVIEW, documented for CINs but valid for DLLs as well, that will let you access LabVIEW-specific data types and work with memory allocated by LabVIEW. For example, the NumericArrayResize function lets you resize a LabVIEW array from external code. You can find a list of these functions in the LabVIEW help, under "Code Interface Node functions."
09-06-2011 11:28 PM
LabVIEW is a complete and full programming language just as C++ is. The difference is that LabVIEW is a graphical programming language. What you see in the block diagram is the code and is at the lowest level. LabVIEW is also a fully compiled language. It just happens under the hood automatically. There is no need to run make files to run your code. The only time a build is required is when you are creating an executable for distribution. If you are working in LabVIEW directly your code is always getting compiled and is runnable at any time (assuming you don't have broken arrows which you can think of as the same as a compiler error in C++).
LabVIEW is also a data flow language which is different than the traditional sequential text based programming languages. As such parallel processing is very easy and happens all the time in a LabVIEW program. When your code is executed it executes any node that has all of it's inputs satisfied. Once it has all of its inputs it will run. Two nodes on the diagram will run in parallel provided an output of one is not wired to the input of the other.
As others have stated you can call code developed in other languages such as by using a dll or .Net assembly. However I don't think that is what you were asking.
09-07-2011 01:33 AM - edited 09-07-2011 01:34 AM
You can also compile LabVIEW programs into DLL, which should be easy enough to call from most other languages.
You cannot, however, create a VI from C++, nor get C++ code from LabVIEW.
/Y
09-07-2011 07:53 PM
I did come across the DLL link, that definitely is a powerful option. However, I was musing as to how the primitive VIs themselves are created. But as it was pointed, this is probably proprietary knowledge so just some guy off the street can't fiddle around with LabVIEW at the software development level. No doubt, LabVIEW in it's graphical form is powerful enough for everything that the average programmer needs.
09-08-2011 11:49 AM
@bratman wrote:
No doubt, LabVIEW in it's graphical form is powerful enough for everything that the average programmer needs.
Yup. And then some.