Hi Marshall now i have another problem with respect the data
Type.I read some attributes from my device but the problem comes when I
want to show them on the pront panel of the user interface because the
commands need a diferente type of values. For example when i use this
function: viGetAttribute (instrument, VI_ATTR_USB_BULK_OUT_PIPE,
&bulkoutpipe); i can only put the name of the variable that i will
use to save the value of the data, and by default this variable is an
integer (teh program uses ViInt16) and till here is ok, i got the value
from my device with any problem, but now the next step is display this
value on the user interface using a text box and i have to use the next
command: InsertListItem (panelHandle, PANEL_CONFIG, 1,
bulkoutpipe, bulkoutpipe); but here by default the variable to show is
a character array and i can not select another type of variable, so
when i run the program i got the message error that says: Type error in
argument 4 to 'InsertListItem';found 'ViInt16' expected 'pointer to
const char'
Here is the code in the function where i have the problem:
int CVICALLBACK GetConfig (int panel, int control, int event,void *callbackData, int eventData1, int eventData2)
{
// char bulkoutpipe[256];
ViInt16 bulkoutpipe;
ViChar name[256];
unsigned char idnresult[72];
ViUInt32 retcount;
switch (event)
{
case EVENT_COMMIT:
DeleteListItem (panelHandle, PANEL_CONFIG, 0, -1);
viGetAttribute (instrument, VI_ATTR_RSRC_NAME, name);
InsertListItem (panelHandle, PANEL_CONFIG, 0, name, 0);
viGetAttribute (instrument, VI_ATTR_USB_BULK_OUT_PIPE, &bulkoutpipe);
// viGetAttribute (instrument, VI_ATTR_USB_BULK_IN_PIPE, &bulkinpipe);
InsertListItem (panelHandle, PANEL_CONFIG, 1, bulkoutpipe, bulkoutpipe);
//viGetAttribute (instrument, VI_ATTR_USB_BULK_IN_PIPE, &bulkinpipe[0]);
// viWrite (instrument, "*IDN?\n", 6, &retcount);
// viRead (instrument, idnresult, 72, &retcount);
// InsertListItem (panelHandle, PANEL_CONFIG, 1, idnresult, 0);
SetCtrlAttribute (panelHandle, PANEL_SAVE, ATTR_DIMMED, 1); //enable the button SAVE
break;
case EVENT_RIGHT_CLICK:
break;
}
return 0;
}
Can you help me again please?. Thanks , bye