Yes, I'm debugging in the CVI environment. When I break this is the displayed statement:
void COM_Callback(int portNo, int eventMask, void *data)
{
unsigned char i,pacchetto[6],after,before;
unsigned int DeltaZCHigh; double valori_input[5];
double valori_out[3];
pacchetto[5]=0;
for (i=0;i<5;i++) pacchetto[5]+=pacchetto[i]=ComRdByte (2); <--- HERE !!
if ((ComRdByte (2))!=pacchetto[5]) tx_err(); DeltaZCHigh=(pacchetto[4]<<8)+pacchetto[3]; DeltaZCHigh=DeltaZCHigh-(10000-DeltaZCHigh);
SetCtrlVal (panelHandle, PANEL_NUMERIC, (DeltaZCHigh*1E-06)); leggi_valori(valori_input);
Calcola_vera(valori_input,valori_out);
visualizza(valori_out);
before=GetInQLen (2);
FlushInQ (2);
after=
GetInQLen (2);
}
At this point, if I proceed step by step, at the end of the callback, it enter again in the com callback, but I think this is right, bacause in the meantime the serial port has received other bytes.
I'm very confused...