- CVI 정보나눔(www.cvi.kr)
- 스터디
- 질문답변
질문,답변
글 수 1,629
늦게 CVI에 들어온 대학생입니다
강좌 따라가기 하다 여기서 자꾸 막힙니다
제가 머를 잘못 했나요??
가르쳐 주세요 ~
plotHandle = PlotY (panelHandle, PANEL_GRAPH, data, NUM, VAL_DOUBLE, VAL_THIN_LINE, VAL_EMPTY_SQUARE, VAL_SOLID, 1, VAL_RED); 이 부분에서
런타임 에러가 뜹니다.
NON-FATAL RUN-TIME ERROR: "L004.c", line 81, col 18, thread id 0x00000C7C: Library function error (return value == -10 [0xfffffff6]). The control is not the type expected by the function
정말 모르겠습니다 ㅠㅜ
//소스
#include
#include
#include
#include "L004.h"
#define NUM 500
#define PI 3.1415926535897932
double data[NUM], T;
int plotHandle;
static int panelHandle;
void Generate_sin_data(void);
void Refresh_Graph(void);
int main (int argc, char *argv[])
{
if (InitCVIRTE (0, argv, 0) == 0)
return -1; /* out of memory */
if ((panelHandle = LoadPanel (0, "L004.uir", PANEL)) < 0)
return -1;
DisplayPanel (panelHandle);
//초기 data 발생 및 그래프 출력
T=250.0;
Generate_sin_data();
Refresh_Graph();
RunUserInterface ();
DiscardPanel (panelHandle);
return 0;
}
int CVICALLBACK Panel_Proc (int panel, int event, void *callbackData,
int eventData1, int eventData2)
{
switch (event)
{
case EVENT_GOT_FOCUS:
break;
case EVENT_LOST_FOCUS:
break;
case EVENT_CLOSE:
QuitUserInterface (0);
break;
}
return 0;
}
int CVICALLBACK numT (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_COMMIT:
GetCtrlVal(panelHandle, PANEL_numT,&T);
Generate_sin_data();
Refresh_Graph();
break;
}
return 0;
}
void Generate_sin_data(void)
{
int index;
for(index=0;index < NUM;index++)
data[index] = sin(2.0*PI*index/T);
}
void Refresh_Graph(void)
{
plotHandle = PlotY (panelHandle, PANEL_GRAPH, data, NUM, VAL_DOUBLE, VAL_THIN_LINE, VAL_EMPTY_SQUARE, VAL_SOLID, 1, VAL_RED);
}
야리싸내
에러내용이 "이 컨트롤에서는 사용할 수 없는 함수입니다."라는 내용으로 보아서 그래프 컨트롤을 만들어야하는데 혹 스트립챠트 컨트롤을 만든건 아닌지..
감사합니다. 제가 컨트롤을 잘못 생각하고 있었네요 문제 해결 하였습니다