06-29-2012 12:49 PM
Hi,
I'm using version 9.0.1 and getting a general protection fault when trying to execute;
PlotIntensity(pan_plot,PANEL_GRAPH_2,(void*)offset,numX,numY,
VAL_DOUBLE,colors,hiColor,numColors,interpColors,FALSE);
where numX=320 and numY=256.
I do use DeleteGraphPlot (pan_plot, PANEL_GRAPH_2, -1, VAL_DELAYED_DRAW);
earlier in the routine.
Any ideas on the cause and correction for this?
Thanks,
Doug.
07-02-2012 05:18 AM
I don't understand your (void *) casting in Z Array parameter: the array should be defined as double offset[256][320] and passed directly to the function.
07-09-2012 10:42 AM
The CVI help file defines the parameters as:
int PlotIntensity (int panelHandle, int controlID, void *zArray, int numberOfXPoints, int numberOfYPoints, int zDataType, ColorMapEntry colorMapArray[], int hiColor, int numberOfColors, int interpColors, int interpPixels);
where the array parameter is cast as void*. The calling routine has defined the offset as;
double offset[NUM_OF_DISPLAY_ROWS][NUM_OF_DISPLAY_COLUMNS];
Thanks,
Doug.
07-10-2012 02:39 AM
The parameter definition is void * since it is an array you can pass to this function arrays of various data types, but actual array passed to the function must match the type defined in Z Data Type parameter; in your case you can simply pass your double array without any casting. See any of the examples listed in the function help for reference.
07-10-2012 03:29 PM
Thanks Roberto.
I removed the reference to void* for the Zarray, but still get the GPF.
Additional note -- even with that casting, the application would plot several times before lapsing into the GPF. Once there it faults every time, even after cycling power on the computer. Removing the void* did not affect that behavior.
Doug.
07-10-2012 11:52 PM
Hi, a double array of 320*256 elements will take 655360 bytes. How is dimensioned your stack? You may be near the stack limit size, and supposing under some condition your program allocates some more space on the stack you are likely to get this error or a similar stack overflow error.
07-26-2012 10:21 AM
Doubling my stack to 1 GB did not stop the GPF. However, if I exit the program, run a different application that uses the PlotIntensity function, exit that and rerun the original program, the GPF does not occur.
07-27-2012 02:28 PM
Hi DMF2,
Does this behavior apply to running any application that uses the PlotIntensity function before you program or a specific one? Is it one of the example programs you are running before it? Have you tried removing the additional graph manipulation that you are doing on this graph before the PlotIntensity to see if the problem still occurs?