12-20-2006 04:50 PM
static double top_val = 20, btm_val = 15;
int rslt;rslt = GetCtrlVal(PANEL, PANEL_R_GRID_TOP, &top_val);
printf("/tGetCtrlVal: rstl 1: %d\n", rslt);
rslt = GetCtrlVal(PANEL, PANEL_R_GRID_BTM, &btm_val);
// next statement cause a General Protection Fault
rslt = SetAxisScalingMode (PANEL, PANEL_GRAPH, VAL_RIGHT_YAXIS, VAL_MANUAL, btm_val, top_val);
rslt = printf("/tSetAxisScalingMode rstl 2: %d\n", rslt);
12-20-2006 06:25 PM
01-04-2007 01:09 PM
" other thing... this is probably not the cause of the crash, but I thought I'd mention it anyway. Your use of 'PANEL' as the panel handle looks suspiciously like the default constant "
Thanks Luis. 'PANEL' was the default constant and it was the cause of the crash. The GUI builder created the display in 'main' and it kept putting in the 'PANEL' constant for all the callbacks. Having about two weeks of experience with CVI, I just continued to use it without problems. The 'PANEL' constant was used over 50 times in various calls throughout the application. I am surprised that I didn't run into problems before this particular call.
I do not recall getting handles for the control objects on the panel and have been using the default constants from the GUI builder as the second option for control calls. Is this the correct way to interface with the panel controls?
Concerning another subject, can anyone offer informed opinions as to Labview verses CVI concerning application development time?
Labview application developers love Labview. I find Labview to be very cumbersome compared to C programming. Most of my time with Labview is spent arranging pictures and figuring out how to use available VI's to accomplish what I consider to be menial tasks using C. My biggest complaints are with file handling and array handling. I got further in two weeks with CVI than the previous two months with Labview. Am I the only one out here with this view?
Thanks,
kgtang
01-04-2007 01:29 PM
01-04-2007 02:18 PM
The LabWindows vs LabView question is so specific to the experience of the programmer and the type of project there is no clear cut answer. Both are great test development tools. The short and very simplistic answer is; If you know C or a similar procedural language, there is no real advantage to switching to LabView unless you are using FPGA based hardware which benefits from LabViews data flow model. Here are a few links:
http://forums.ni.com/ni/board/message?board.id=180&message.id=13500&requireLogin=False
http://forums.ni.com/ni/board/message?board.id=180&message.id=5473&requireLogin=False