You have placed a lot of problems in a single question. Here you have some hints to let your project go on a little.
Question 1: The checkbox.
If the checkbox callback is exactly the one you reported in your question, you are not checking the control status anyway. To know if the box is checked or not you must add those lines:
int CVICallback read (int panel, int control, int event,
void*callbackData, int eventData1, int eventData)
{
int val;
switch (event) {
case EVENT_COMMIT;
GetCtrlVal (panel, control, &val); // Read the control status
if (val) {
// Box checked: put your program in automatic mode
}
else {
// Box uncheked: ask the user the value
}
err=FP_Read (FP_handle,IO_handle,value,256,�tamp);
if (err) {
printf (�passed\n�);
}
}
return 0;
}
Question 2: Reading a file
a. err= GetFileInfo (�c:\\Text\\text�,&Point);
This function returns you the size (in bytes) of the file passed to it. You can use it to ensure that the file exists, checking the return value. The problem in this line is that you are pointing to a file different from the one read in the following ("c:\\Text\\text" is different from "c:\\Text\\text.txt": the function doesn't recognizes any automatic extension);
b. file1=OpenFile(�c:\\temp\\Text.txt�, VAL_READ_ONLY, VAL_OPEN_AS_IS, VAL_ASCII);
c. placed_bytes = ReadFile (file1, Bufferdata, 250);
d. err = CLOSEFile (file1);
These lines are ok. I would suggest you to check for I/O errors while managing files, in order to avoid unexpected errors for file not existing or file format unrecognized and so on...
At this point you must scan BufferData string to separate it into single values and store them in memory: you can use sscanf to manage it (or you can replace ReadFile + sscanf with ScanFile: look in the Standard Libraries reference manual for the use of scanning functions).
Question 3: Table in the uir
If you intend to use the CVI Table COntrol, I suggest you to look at
\samples\userint\gridview.prj
example that is useful for understand how to use the table control.
Look particularly at these functions:
InitTableCells (hmainPanel, MAINPNL_DATA);
It prepares the table to have a given number of rows and columns.
GenDataToTable (hmainPanel, MAINPNL_DATA, g_waveform, FUNC_1);
This one fills the table cells with values.
In my opinion you are trying to understand and manage too much items at the same time.
Focus yourself in making a good user interface, not considering for the moment the operative part of the program. Once the user interface works well, add step by step the operative tasks. This way you can discriminate the behaviour of the individual parts of your program and manage the problems in the right way.
Hope to have helped you.
Roberto