karthigesh
February 10th, 2003, 10:18 PM
DEAR PARESH ,
its me again...
jus finished my presentation and realised that program is not working correctly...
i need to hand it up by thursday morning...
this is my problem :
there is this checksum function, it should output either a (FF) or (01) but it is giving an output like (5a)
please do check for on wat is wrong wif the part !!!
void CheckSum(byte[]cmd, int size)
{
int i;
byte sum = 0; for (i=0; i<size-2; i++)
{
sum = (byte)(sum + cmd[i]);
}
cmd[size-2] = (byte)(sum & 0xff); //LOBYTE(sum)
cmd[size-1] = (byte)(sum >>8); //HIBYTE(sum)
MessageBox.Show("CheckSum"+cmd[size-1].ToString());
}
------------------------------------------------------------------------------------
please help me edit if u think that there is any problem .....
thanking you in advance !
karthik...
its me again...
jus finished my presentation and realised that program is not working correctly...
i need to hand it up by thursday morning...
this is my problem :
there is this checksum function, it should output either a (FF) or (01) but it is giving an output like (5a)
please do check for on wat is wrong wif the part !!!
void CheckSum(byte[]cmd, int size)
{
int i;
byte sum = 0; for (i=0; i<size-2; i++)
{
sum = (byte)(sum + cmd[i]);
}
cmd[size-2] = (byte)(sum & 0xff); //LOBYTE(sum)
cmd[size-1] = (byte)(sum >>8); //HIBYTE(sum)
MessageBox.Show("CheckSum"+cmd[size-1].ToString());
}
------------------------------------------------------------------------------------
please help me edit if u think that there is any problem .....
thanking you in advance !
karthik...