labview/cvi 出现错误 求大神指点
#include"toolbox.h"#include<analysis.h>#include<cvirte.h>#include<userint.h>#include"...
#include "toolbox.h"
#include <analysis.h>
#include <cvirte.h>
#include <userint.h>
#include "实验八.h"
int EventFunction();
static int panelHandle;
int main (int argc, char *argv[])
{
if (InitCVIRTE (0, argv, 0) == 0)
return -1; /* out of memory */
if ((panelHandle = LoadPanel (0, "实验八.uir", PANEL)) < 0)
return -1;
DisplayPanel (panelHandle);
RunUserInterface ();
DiscardPanel (panelHandle);
return 0;
}
int CVICALLBACK graph (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
double sin[1024]; double x[1024]; int i;
switch (event)
{
case EVENT_COMMIT:
for(i=0;i<1024;i++)
x[i]=i;
SinePattern (1024, 1.0, 0.0, 1.0, sin);
PlotXY (panelHandle, PANEL_GRAPH, x, sin, 1024, VAL_DOUBLE, VAL_DOUBLE, VAL_THIN_LINE, VAL_EMPTY_SQUARE, VAL_SOLID, 1, VAL_RED);
break;
}
return 0;
}
int CVICALLBACK stripchart (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{ int i;double value[100];
switch (event)
{
case EVENT_COMMIT:
//for (i=0;i<100;i++)
// value[i]=Random(0,100);
// PlotStripChart (panelHandle, PANEL_STRIPCHART, value, 100, 0, 0, VAL_DOUBLE);
InstallMainCallback (EventFunction, 0, 1);
SetIdleEventRate (100);
break;
}
return 0;
}
int CVICALLBACK digitalgraph (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{ int array[12]={0,2,3,5,6,0,15,0,9,21,0,1};
switch (event)
{
case EVENT_COMMIT:
PlotDigitalLines (panelHandle, PANEL_DIGGRAPH, array, 12, VAL_INTEGER, 3);
break;
}
return 0;
}
int CVICALLBACK EventFunction (int panelOrMenuBarHandle, int controlOrMenuItemID, int event,
void *callbackData, int eventData1, int eventData2)
{ int a;
double value[1];
value[0]=Random(0,100);
a = PlotStripChartPoint (panelHandle, PANEL_STRIPCHART, value[0]);
return 0;
}
int CVICALLBACK QuitCallback (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_COMMIT:
QuitUserInterface (0);
break;
}
return 0;
}
运行时没有错误,退出时却出现错误
NON-FATAL RUN-TIME ERROR: "实验八.c", line 75, col 10, thread id 0x000008B4: Library function error (return value == -13 [0xfffffff3]). Invalid control ID 展开
#include <analysis.h>
#include <cvirte.h>
#include <userint.h>
#include "实验八.h"
int EventFunction();
static int panelHandle;
int main (int argc, char *argv[])
{
if (InitCVIRTE (0, argv, 0) == 0)
return -1; /* out of memory */
if ((panelHandle = LoadPanel (0, "实验八.uir", PANEL)) < 0)
return -1;
DisplayPanel (panelHandle);
RunUserInterface ();
DiscardPanel (panelHandle);
return 0;
}
int CVICALLBACK graph (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
double sin[1024]; double x[1024]; int i;
switch (event)
{
case EVENT_COMMIT:
for(i=0;i<1024;i++)
x[i]=i;
SinePattern (1024, 1.0, 0.0, 1.0, sin);
PlotXY (panelHandle, PANEL_GRAPH, x, sin, 1024, VAL_DOUBLE, VAL_DOUBLE, VAL_THIN_LINE, VAL_EMPTY_SQUARE, VAL_SOLID, 1, VAL_RED);
break;
}
return 0;
}
int CVICALLBACK stripchart (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{ int i;double value[100];
switch (event)
{
case EVENT_COMMIT:
//for (i=0;i<100;i++)
// value[i]=Random(0,100);
// PlotStripChart (panelHandle, PANEL_STRIPCHART, value, 100, 0, 0, VAL_DOUBLE);
InstallMainCallback (EventFunction, 0, 1);
SetIdleEventRate (100);
break;
}
return 0;
}
int CVICALLBACK digitalgraph (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{ int array[12]={0,2,3,5,6,0,15,0,9,21,0,1};
switch (event)
{
case EVENT_COMMIT:
PlotDigitalLines (panelHandle, PANEL_DIGGRAPH, array, 12, VAL_INTEGER, 3);
break;
}
return 0;
}
int CVICALLBACK EventFunction (int panelOrMenuBarHandle, int controlOrMenuItemID, int event,
void *callbackData, int eventData1, int eventData2)
{ int a;
double value[1];
value[0]=Random(0,100);
a = PlotStripChartPoint (panelHandle, PANEL_STRIPCHART, value[0]);
return 0;
}
int CVICALLBACK QuitCallback (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_COMMIT:
QuitUserInterface (0);
break;
}
return 0;
}
运行时没有错误,退出时却出现错误
NON-FATAL RUN-TIME ERROR: "实验八.c", line 75, col 10, thread id 0x000008B4: Library function error (return value == -13 [0xfffffff3]). Invalid control ID 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励30(财富值+成长值)
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询