LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

program is crashing while using Fillbytes

Program is crashing during the execution of this function. When tried in debug mode found that its crashing during the Fillbytes function. ( FillBytes(readback, 0, 2, 0x00); )

 

 

int test_1_041_av850(tData *data)
{
char readback[2];
TestComplete[1][5]=1;
if (TEST_RUN_MODE == PARTIAL_TEST)
{
if (TestComplete[1][4] == 0) test_1_040_av850 (&dummy);
}
// SetCtrlVal(MainPanelHandle,MainPanel_RunTimeMessagesText,"Readback created");


FillBytes(readback, 0, 2, 0x00);

RTIU_Change_Page ("N");

Delay(1.0);



/*if (ConfirmPopup ("",
"Is EMRG MIC RET on video monitor is LOW?"))
data->iMeasurement = 1;
else
data->iMeasurement = 0;*/
SetCtrlVal(MainPanelHandle,MainPanel_RunTimeMessagesText,"Reached RTIU Loc 1_041");

if (RTIU_Read_Loc (36, 9, 1, 1.0, readback) < 0)
return (-1);

SetCtrlVal(MainPanelHandle,MainPanel_RunTimeMessagesText," RTIU Loc Completed 1_041");

if (CompareStrings (readback, 0, "L", 0, 0) == 0)
data->iMeasurement = 1;
else
data->iMeasurement = 0;

return (0);
}

0 Kudos
Message 1 of 2
(1,845 Views)

Why don't you just initialize instead of calling a function for 2 bytes ?

char readback[2]={'\0','\0'};

0 Kudos
Message 2 of 2
(1,793 Views)