10-13-2015 11:32 AM
I am trying to follow the tutorial "Using External Code in LabVIEW," http://www.ni.com/pdf/manuals/370109a.pdf. I am using Microsoft Visual Studio Community 2015, which is quite different than the IDE described in the tutorial. Still, I hacked my way through the instructions until I get to the part where I try to build the dll. At that point, I get an error message stating that the program "cannot open source file "extcode.h." Does anyone have ideas as to why this might be happening? At this point, my C++ code looks like this:
/* Call Library source file */
#include "extcode.h"
_declspec(dllexport) long avg_num(float a[], long size, float *avg);
_declspec(dllexport) long avg_num(float a[], long size, float *avg)
{
int i;
float sum=0;
if(a != NULL)
{
for(i=0;i < size; i++)
sum = sum + a[i];
}
else
return (1);
*avg = sum / size;
return (0);
}
Thanks.
10-13-2015 12:42 PM
1... You didn't specify which LabVIEW version you are using; I've no idea why not.
2... Your link is gorched. try http://www.ni.com/pdf/manuals/370109a.pdf .
3... The doc you tried to link to is dated July 2000.
4... I believe that External Code has been deprecated as of LV 2012 / 2013 (not sure which), in favor of using only DLLs / shared libraries.
You should either:
--- Revert to an older version of LabVIEW
or
--- Build a DLL / shared library, using the manuals appropriate to your LV version.
Blog for (mostly LabVIEW) programmers: Tips And Tricks