LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

View variable value - memory block in 6.0

After memory allocation (calloc, malloc - see a very simple example
below) and using "View variable value - Shift F7" in CVI 6.0:

if size <= 2048 , the displayed number of array elements is equal to
size (everything is OK), but
if size >= 2049, the displayed number of array elements is:
(size * 😎 of elements for double and float array
(size * 4) of elements for int array
(size *2) of elements for short array
(size *1) of elements for char array

The size of allocated memory seems to be correct, only the "View
variable value - Shift F7" displays incorrect (bigger) number of array
elements than the real valid number.

In CVI 5.0, "View variable
value - Shift F7" displays always the correct
number of elements for any size and type of array. My OS is Win98SE.

Can somebody explain this fact? Have I neglected something new - an
option in CVI ver. 6.0?

Thanks

Jan Saliga


#include
#include
static double *array;
unsigned size= 2049;

int main (int argc, char *argv[])
{
if (InitCVIRTE (0, argv, 0) == 0)
return -1; /* out of memory */
array= (double *) malloc (size * sizeof(double));
//set breakpoint here a display variable "array"
free (array);
return 0;
}
0 Kudos
Message 1 of 3
(3,016 Views)
I'm using Windows 2000 with the same type of results.... The only difference is I get an error message from CVI that says "Item is to large to expand. Would you like to use the array display?" All items written to array seem to be in there and any attempts to write beyond the end generate error messages. This seem to be a bug with the "array display". Maybe National has some answers!
0 Kudos
Message 2 of 3
(3,016 Views)
Hi Jan,

Even though this does not affect in any way your program, we agree with you that this is not correct behavior. We have fixed this array display to reflect the correct number of elements. The upcoming release of CVI will reflect this fix. We apologize for any inconvenience this may cause you but thanks for bringing that up.

Regards,

Azucena Perez
National Instruments
0 Kudos
Message 3 of 3
(3,016 Views)