LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to call *.C file in LV

Hi frenz,

i have created .C file for addtion of two numbers. Now i need to call that file from LabVIEW. How is it possible?.

 

Thanks in Advance 

0 Kudos
Message 1 of 2
(2,691 Views)

ragupathi wrote:

Hi frenz,

i have created .C file for addtion of two numbers. Now i need to call that file from LabVIEW. How is it possible?.

 

Thanks in Advance 


Well, considering the functionality you implement it would be about 1000% easier to implement that directly in LabVIEW. This is in fact a statement that is true for many programming problems although the amount of advantage you get will vary a bit.

 

If you insist on using your C file approach you will have to find a C compiler that can create a DLL from that C file. This will likely require you to study a bit about DLLs and how to create them in your C compiler. And then some more studies about how to call a DLL from LabVIEW using the Call Library Node.

 

But implementation of C code to be used in LabVIEW has only two really good reasons.

 

1) If you already have the entire C code available and want to reuse it as library in LabVIEW. Rewriting everything in LabVIEW is in that case often not a feasable option.

 

2) If you need to do low level stuff like calling into system APIs, calling device drivers, or doing general low level stuff that requires a lot of bit shuffling such as compression/decompression or encryption/decryption algorithmes.

 

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 2 of 2
(2,684 Views)