11-02-2008 09:12 AM
Hi
I want to use the following Labview/CVI commando: PlotWaveform in Visual Studio 2008.
But I get a -10 return error when I try to use PlotWaveform.
I use the following 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
I do get a graph frame but no graph. And the frame that shows is not running correct.
What is the problem with the PlotWaveform function, what does the -10 error indicate?
BR
Benjamin
Solved! Go to Solution.
11-02-2008 08:25 PM
Benjamin,
That error means that you're passing a control of the wrong type to the function in question. And that is because you are creating a control of type CTRL_NUMERIC instead of CTRL_GRAPH or CTRL_GRAPH_LS.
Luis
11-03-2008 02:15 AM
Hi
Great it worked 🙂
But the window that appears with the graph is freezing, do you need some more commands to make it into a window that you can move around?
BR
Benjamin
11-03-2008 09:11 AM
Hi
I have solved the problem.