LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change C compiled code into Labview format

Hi,

Is there ne utility tools which i could use to change C compiled code into
..lsb format??

Thx
Abhimanyu
0 Kudos
Message 1 of 8
(3,044 Views)
Not to my knowledge.

You might be able to get away by creating a .lsb that calls your C compiled code.

Hope that helps.

Shan Pin Koh
0 Kudos
Message 2 of 8
(3,044 Views)
I only have borland builder..... and it doesn't create .lsb files.... so
what do i do??

there has to be some other way of doing this.....

Abhimanyu..

Shan Pin Koh wrote in message
news:50650000000500000044330000-993342863000@exchange.ni.com...
> Not to my knowledge.
>
> You might be able to get away by creating a .lsb that calls your C
> compiled code.
>
> Hope that helps.
>
> Shan Pin Koh
0 Kudos
Message 3 of 8
(3,044 Views)
If you can create a DLL using Borland, you could possible use a DLL to call your existing code. You can then use that DLL from LabVIEW using "Call Library Function".
0 Kudos
Message 4 of 8
(3,044 Views)
Thats true...and i using that feature right now....but it has a drawback of
calling just one function at a time.... which is counter productive for
me....

I have around 7 to 8 functions in the dll which i call thru the "call
library function" option...but i still have to pass the values of my
arguments to it..... where as i used that same dll with my application
earlier and all the required values would be passed to the dll from the
application....

So, now i want to use labview.....but i can't find a way to link my
application to labview so that I won't have to provide the argument's
values....instead labview should pick them up from my application code..

thx for ur help...

Abhimanyu Rastogi
Shan Pin Koh wrote in message

news:50650000000500000054330000-993342863000@exchange.ni.com...
> If you can create a DLL using Borland, you could possible use a DLL to
> call your existing code. You can then use that DLL from LabVIEW using
> "Call Library Function".
0 Kudos
Message 6 of 8
(3,044 Views)
> Thats true...and i using that feature right now....but it has a drawback of
> calling just one function at a time.... which is counter productive for
> me....
>
> I have around 7 to 8 functions in the dll which i call thru the "call
> library function" option...but i still have to pass the values of my
> arguments to it..... where as i used that same dll with my application
> earlier and all the required values would be passed to the dll from the
> application....
>
> So, now i want to use labview.....but i can't find a way to link my
> application to labview so that I won't have to provide the argument's
> values....instead labview should pick them up from my application code..
>
> thx for ur help...
>

Are the functions in the DLL safe to be called in parallel? If so, in the
configuration node, mark the DLL as being reentrant. The color of the node
will change from orange to yellow. This will speed up access and will allow
multiple places in the diagram to call into the DLL at the same time.

Just a note of warning. Don't guess about this. Ask someone who knows for
certain whether the DLL is thread-safe, reentrant, or mutexed. If it is not
safe, leave it orange, otherwise, you will end up with crashes or bad data
returning from the DLL that is very difficult to debug.

I'm still not sure I understand the other issue. If you are talking about
configuring the DLL node to know the types to pass to the DLL. This is
what happens in the application that uses the DLL. Someone has to write
the code that makes the call. If they pass the data incorrectly, it either
will not compile or it will crash when executed. Given the header file,
..h file, this will probably not be that hard.

Another thing that you may be wanting to do is to call an executable, an
EXE file. If that is what you want to do, look at using the System Exec
function.

If you are still looking for a way to call the DLL without passing the
parameters that it requires, then I'm afraid that is the way it works.
Any and all callers to the DLL will need to pass the parameters, no matter
what language they are using.

Greg McKaskle
0 Kudos
Message 7 of 8
(3,043 Views)
Because LabVIEW only supports a small number of C compilers for the creation of CINs, that is why it is probably better to just use the Call Library Function if you have a DLL or have the source code to create one.
0 Kudos
Message 5 of 8
(3,043 Views)
Use microsoft C compiler version 4 for loading code into the code interface
nodes, would be my guess. I don't have it so good luck.
Boaz
aargh
0 Kudos
Message 8 of 8
(3,043 Views)