LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

viByte to table of string

I am trying to write an array that is of type ViByte to table string. If I typecast then I receive 'General Protection' fault at 001B:68561DF7 error. The variable has to be of ViByte to start with. Here is the snippet of code:

 

 

int CVICALLBACK table (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
    ViByte Data[32] = {1,2,3,4,5,6,7,8,9,10,
                        11,12,13,14,15,16,17,18,19,20,
                        21,22,23,24,25,26,27,28,29,30,
                        31,NULL};
      
    int column_index = 1;
    int row_index = 1;
    
    if ( EVENT_COMMIT == event )
    {
        for(row_index = 0; row_index <= 31; row_index++)
        {
            SetTableCellVal (panel, control, MakePoint(column_index, (row_index+1)),
                Data+row_index);
        }
}
   
    return 0;
}

 

Table is 5 col x 32 rows and need to write this data in the 1 column. 

TIA.

*************************************************
CLD
*************************************************
0 Kudos
Message 1 of 2
(2,823 Views)

I think following statement

 

SetTableCellVal (panel, control, MakePoint(column_index, (row_index+1)), Data+row_index);

 

should be replaced by

 

SetTableCellVal (panel, control, MakePoint(column_index, (row_index+1)), *(Data+row_index));

 

Regards

0 Kudos
Message 2 of 2
(2,815 Views)