LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can i create an c-code

How can i create an c-code from labview?
I have an programm which is written by labview and now i want to convert it to an c-code or c++, or vhdl, so that i can read the syntax in text-form not in labview as "Block-Diagram".
The advance is, that i can work easy with Lab and the result is an c-syntax, that would be fine 🙂
 
Is this possible?
and how can i do this?

0 Kudos
Message 1 of 10
(5,508 Views)

You CANNOT create c-code from LabVIEW.

But, you can call LabVIEW code from C, C++, VC++, VB or .Net as a dll and vice-versa.

Do a search in the NI site in the title "Calling code written in LabVIEW from C" or "Calling external Code from LabVIEW". It ll yield you some good materials for getting started.

- Partha ( CLD until Oct 2024 🙂 )
0 Kudos
Message 2 of 10
(5,498 Views)
Hi chefcommander,

there's no way to convert LabView G-code to C(#) using a standard LV installation.
But there is a special package which allows for programming of embedded devices, this works by conversion to C. Backdraw: it will cost you a lot of dollars!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 10
(5,497 Views)


@chefcommander wrote:
I have an programm which is written by labview and now i want to convert it to an c-code or c++, or vhdl, so that i can read the syntax in text-form not in labview as "Block-Diagram".

Even as you call LabVIEW code converted into a Dll from C or C++. I dont think you ll be able to "read" the syntax & all those kinda things.

What you can do is you should be knowing the variables' datatypes & the parameter passage/return type protocol when you convert a LV program into a Dll. This is because when you give a Dll to a C++ development fellow, he/she ll bee able to read the .h file that gets created with the Dll when you do the build process.

- Partha ( CLD until Oct 2024 🙂 )
0 Kudos
Message 4 of 10
(5,495 Views)
Hi,
Thank you
Gerd, is this tool for embeded devices only for national instruments devices, or also for other devices, like from Xilinx?
The result of my experiment is, that i will write the programm under Labview and than i will implement it in an FPGA, like a VHDL-code.
With FPGA-national instruments devices  it is no problem and easy to implement, but is there a way to implement it for example in Xilinx-boards, which are not from national instruments? because normaly i work with national instruments boards, but this board has some special features, thats the reason.

THX
0 Kudos
Message 5 of 10
(5,486 Views)
Hi chefcommander,

frankly: I don't know...

It's not the first time someone asked for conversion to C(#) and I just gave you the summary of the answers given then.

Why don't you just phone your next NI sales representative?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 10
(5,483 Views)
Ok THX i think i will do this
0 Kudos
Message 7 of 10
(5,480 Views)
I do not have any actual experience with the FPGA module, but as far as I know, NI does NOT manufacture FPGA chips and all the chips used in NI hardware are in fact Xilinx chips or ADI chips. The LabVIEW FPGA module translates the G code to VHDL code, which I believe you can then edit yourself.

As mentioned, LV does have a module for translating to C (it's called LV embedded), but I believe that will only work on specific boards or boards where you build the C compiler yourself. I don't think it would be just standard C you can easily use. As suggested, talking to NI is probably the best thing.

___________________
Try to take over the world!
Message 8 of 10
(5,345 Views)
This embedded toolkit does exactly what you ask for. It creates C code. Like
GerdW said, it cost top $$ (slightly more then 10000).

If you have a C compiler for the target, you can compile to it. There are
some requirements: RAM >256k and it has to be a 16 or 32 bit processor
(although it probably will work on a 8 bit processor, if the compiler
supports 32 bits numbers).

Don't think the C code will look like a self written C program! The code is
written to the entire multitasking paradigm works, so the code is hard to
read. You switch this off (so you don't get multitasking), but this one of
the best features of LabVIEW.

It's not an "out of the box" sollution. Unless you by LV for Blackfin, you
need to invest weeks to make the compile work, and to integrate the
toolchain in LabVIEW. You need to be experianced in the target, the
compiler, and LabVIEW. There are examples for Linux, Windows command line
and eCos.

Regards,

Wiebe.


Message 9 of 10
(5,110 Views)
Ok i have install everythink what my institut has as licences:
Is it NI-RIO for Real-Time Embedder Targets? or FPGA Compiler Server/Module? or Aplication Builder? or NI PID Toolkit? or NI-Embedded RT? or how is the right name for this tool? and how can i know if it install on my pc?


THX
0 Kudos
Message 10 of 10
(5,063 Views)