LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can we call a C program in Labview

Hi
a) In one of our application we have to call a C progran in Labview. I am not able to call it. Can somebody help me.
 
b) When we call a C program ,is  Labview makes block diagram for it.
 
Please reply
Thanking You
Message 1 of 13
(4,083 Views)

hi there,

to execute applications (*.exe) you can use the "System Exec.vi". You can found it in the Communications - palette. to call dlls functions use the "Call library function node" in the Advanced - palette. See the only help for more information or read the "Using external code in LabVIEW" manual.

LabVIEW won't create any diagrams out of compiled Code.

Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 2 of 13
(4,073 Views)

Hi chrisger

I am not able to call C program in LabVIEW. Please send an example by which i can learn how to call a C program.

It is very urgent.

Thanxs

0 Kudos
Message 3 of 13
(4,055 Views)

hi there

well, then we need more information what you mean with a "C program". are you talking about C source code, a command line executable, a high end executable with a GUI, a dll, ActiveX.... what are the parameters you have to pass? what parameters are returned from the "C program"? please post some code....

as a startup you could search the examples shipped with LV. open the example finder from the runtime menu.

 

Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 4 of 13
(4,048 Views)

Hi

thanxs for quick reply.

Actually my senior (he does not Labview) wants me to Call a C program (any simple program say C program for the addition of two numbers) in labview . He just wants to check how  i am calling a C program. Till now i am not able to call .

please reply as soon as possible

 

0 Kudos
Message 5 of 13
(4,042 Views)
please post that c programm
Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 6 of 13
(4,040 Views)

plz find the attached code.

I copied it in Notepad.

0 Kudos
Message 7 of 13
(4,034 Views)

well, first you have to compile this code and generate an executable. then call this executable with the "System Exec vi". see online documentation of "System Exec vi" for more information.

 

Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 8 of 13
(4,025 Views)
The other option is to create a dll from the c code and call it with the Call Library Function Node.
0 Kudos
Message 9 of 13
(4,012 Views)
dennis is right, a dll gives you much better options for parameter passing than System Exec.vi
Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 10 of 13
(4,008 Views)