LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

putting code into CIN makes errors

Hi,

I am sorry to ask so many questions, but I am having a terrible time with
this. My code compiles perfectly when I compile it by itself. However, as
soon as I paste it into the space in the CIN provided c code, I get 11 errors.
Why is this? I would appreciate any info I can get. Thanks for your time

JMH
0 Kudos
Message 1 of 2
(2,483 Views)
"JMH" wrote:
>>Hi,>>I am sorry to ask so many questions, but I am having a terrible time
with>this. My code compiles perfectly when I compile it by itself. However,
as>soon as I paste it into the space in the CIN provided c code, I get 11
errors.>Why is this? I would appreciate any info I can get. Thanks for your
time>>JMH

If you can compile your C code into a dll, then I recommend that you use
a Call Library Function (CLF) instead of a CIN. The amount of steps that
you need to follow to make a CIN work can become frustrating. With a CLF,
you need only make a function prototype, and you're done! The main advantage
that a CIN gives is that you have the ability to resize the dataspace a variable
has inside the code. For example, if you pass an a
rray of 100 DBLs out of
LabVIEW (into your C code)and try to pass 150 DBLs back into LabVIEW (from
your C code)then bad things will happen. There exists CIN tools that allow
you to resize the dataspace, so that LabVIEW will allocate a larger buffer
for the return data, and no errors will occur. If you are not resize dataspaces,
then don't worry. If you are, then just include the labview.lib library
in the LabVIEW/cintools/win32 directory.

For more information on calling dlls, look at this article: http://ni.com/support/labview/program/callcode/callmain.htm

Cheers!
Joel Andersen
0 Kudos
Message 2 of 2
(2,483 Views)