bandersen
-
Posts
3 -
Joined
-
Last visited
Content Type
Profiles
Forums
Downloads
Gallery
Posts posted by bandersen
-
-
QUOTE (crelf @ Oct 28 2008, 11:03 PM)
I'm confused - are you trying to call LabVIEW from Visual Studio, or are you trying to call LabWindows/CVI? LabVIEW and Labwindows/CVI are two very different things.Hi
I am trying to call LabWindows/CVI from Visual Studio, I want to use the function PlotWaveform.
BR
Benjamin
-
Hi
I want to use the following Labview/CVI commando: PlotWaveform in Visual Studio 2008.
I have included the following files:
#include "stdafx.h"
#include <stdio.h>
#include <winsock2.h>
#include <stdlib.h>
#include <utility.h>
#include <ansi_c.h>
#include <cvirte.h>
#include <userint.h>
I have linked to the following Labview DLL files: WS2_32.lib labview.lib lvsb.lib
I have the following relevant commands in my project:
//Setup CVI
if (InitCVIRTE (0, 0,0)==0)
return -1; //Out of memory
// Plot waveform
PlotWaveform (panelHandle, PANEL_GRAPH, waveformPtr,
numberofpoints, VAL_DOUBLE, 1.0,0.0,InitialX,
XInitial,VAL_THIN_LINE,VAL_NO_POINT, VAL_SOLID, 1, VAL_BLUE);
// Refresh graph now
RefreshGraph (panelHandle, PANEL_GRAPH);
But I get the follownig error:
Error 1 error LNK2001: unresolved external symbol _InitCVIRTEEx@12
Error 2 error LNK2001: unresolved external symbol _PlotWaveform@72
Error 3 error LNK2001: unresolved external symbol _RefreshGraph@8
I donĀ“t understand the error, could it bee a linker problem?
Does anyone understand the errors? Or do you have a guide for how you use Labview commands in Visual Studio?
I have used the following guide:
http://www.ni.com/pdf/manuals/370109b.pdf
But I ended up with the errors I explained.
BR
Benjamin
Visual Studio 2008 with Labview command
in Calling External Code
Posted
QUOTE (Wendy L @ Nov 1 2008, 03:56 AM)
Hi
And thanks for the answers. I have been told that it is possible to include the .h files from Labview and then use these files to do the drawing of the graph. I have also solved the linker problem. But now I get a -10 error when I try to use PlotWaveform. Could you please have a look at my code:
#include "stdafx.h"
#include <stdio.h>
#include <winsock2.h>
#include <stdlib.h>
#include <utility.h>
#include <ansi_c.h>
#include <cvirte.h>
#include <userint.h>
if (InitCVIRTE (0, 0,0)==0)
return -1; //Out of memory
int panelHandle = NewPanel(parentPanel,"Graph",top,left,height,with);
printf("panelHandle: %d\n",panelHandle);
int nNewCtrl = NewCtrl(panelHandle,CTRL_NUMERIC,0,10,10);
printf("nNewCtrl: %d\n",nNewCtrl);
DisplayPanel (panelHandle);
int PlotWaveform_RETURN_VALUE = PlotWaveform (panelHandle, nNewCtrl, myArray,4,VAL_DOUBLE,1.0,0.0,0.0,1.0,VAL_FAT_LINE,VAL_DOTTED_SOLID_SQUARE,VAL_SOLID,1,VAL_RED);
printf("PlotWaveform_RETURN_VALUE: %d\n",PlotWaveform_RETURN_VALUE);
RefreshGraph (panelHandle, nNewCtrl);
The result when I run the program is the following:
panelHandle: 1
nNewCtrl: 2
PlotWaveform_RETURN_VALUE: -10
What is the problem with the PlotWaveform function, what does the -10 error indicate?
BR
Benjamin