int CVICALLBACK load_plot (int panel, int control, int event, void *callbackData, int eventData1, int eventData2) { int color; switch (event) { case EVENT_COMMIT: color=0; FileSelectPopupEx ("d:\\data\\test", "*.*", "txt", "Load data", VAL_LOAD_BUTTON, 0, 0, pathname); memset(data2fit, 0, sizeof(data2fit)); FileToArray (pathname, data2fit, VAL_DOUBLE, 10000, 1, VAL_GROUPS_TOGETHER, VAL_GROUPS_AS_ROWS, VAL_ASCII); plot_data (color); break; } return 0; }
int CVICALLBACK load_plot (int panel, int control, int event, void *callbackData, int eventData1, int eventData2) { int color; static char read_buffer[10000] ; switch (event) { case EVENT_COMMIT: color=0; FileSelectPopupEx ("d:\\data\\test", "*.*", "txt", "Load data", VAL_LOAD_BUTTON, 0, 0, pathname); memset(data2fit, 0, sizeof(data2fit)); FileToArray (pathname, read_buffer, VAL_CHAR, 10000, 1, VAL_GROUPS_TOGETHER, VAL_GROUPS_AS_COLUMNS, VAL_BINARY); ConvertArrayType (read_buffer, VAL_CHAR, data2fit, VAL_DOUBLE, 10000); // printf("%s, value:%f\n",pathname, data2fit[100]); plot_data (color); break; } return 0; }