LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

unsigned char array to callbackdata problem with memset

Solved!
Go to solution

i'm going deeper into this argument and having some problem.

 

i have this structure

 

typedef struct t_evtype
{
	int addr;
	unsigned char line;
}s_evtype;

and defined a matrix variable

 

static s_evtype o_[32][8] = {0};

after i assigned this variable to the callbackdata

 

 

SetCtrlAttribute (panelOutputHandle, PANEL_OUT_TABLE, ATTR_CALLBACK_DATA, o_);

in the callback i've done this to read it

 

 

s_evtype (*o_)[32][8] = callbackData; // A pointer to an array of integers

and seems working but i have a problem when i have to use it.

 

i have a function that need as input a pointer to a s_evtype

void offout(s_evtype *evptr)

and when i pass the data like this

offout(o_[byte][bit]);

the pointer passed is wrong.

to get the correct pointer i have to do this

static s_evtype returnpointer(s_evtype o_[32][8], int byte, int bit)
{
	return o_[byte][bit];
}

and use a temp variable for the offout function...

 

i hope it's clear, i know is not a simple question

 

Davide Vittorio G. - TLGB S.R.L.
Italian SW Developer
0 Kudos
Message 11 of 11
(628 Views)