I'm trying to write a simple Labview DLL that, when called, pops up a graph
window and plots the data supplied. The prototype in App Builder is
void PlotSingleGraph(float64 Data_X[], float64 Data_Y[], int32 numPoints)
where numPoints is the length input for both arrays. I'm calling it using
this code (WinNT, VisualC++ 6);
#include "stdafx.h"
#include "I:\Program Files\LabVIEW 6\cintools\extcode.h"
#include "I:\Program Files\LabVIEW 6\user.lib\Construction Yard\DLL
stuff\SingleGraphWindow.h"
#include
int main(int argc, char* argv[])
{
float64 x_array[10]={0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
float64 y_array[10]={0, 1, 4, 6, 16, 25, 36, 49, 56, 81};
int32 numPoints=10;
PlotSingleGraph(x_array, y_array, numPoints);
cout << x_array[5];
return 0;
}
No errors are reported, yet when the function is called the data is not
passed; the window opens, but the front panel array controls are empty and
the graph is blank. There seems to be nothing different in the "separate
array" example supplied on ni.com. Does anyone have any suggestions as to
what could be happening?
Incidentally, I explicitly include extcode.h and remove it from App
Builder's header file to simplify things, with files stored in different
places.
--
Craig Graham
Physicist/Labview Programmer
Lancaster University, UK