From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI development using C++

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?

0 Kudos
Message 1 of 7
(2,485 Views)
I am not too sure what you are asking. You can call a dll. If you are asking about creating a VI from LabVIEW I don't think it is possible. The format is proprietary.
=====================
LabVIEW 2012


0 Kudos
Message 2 of 7
(2,479 Views)

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."

0 Kudos
Message 3 of 7
(2,478 Views)

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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 4 of 7
(2,468 Views)

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

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 7
(2,456 Views)

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.

0 Kudos
Message 6 of 7
(2,413 Views)

@bratman wrote:

 No doubt, LabVIEW in it's graphical form is powerful enough for everything that the average programmer needs.


Yup. And then some.

0 Kudos
Message 7 of 7
(2,397 Views)