that is the point i canīt help. Nomaly i start the debuger than you se what happends.
I is only math, you need to find the right calculation.
Stefan
Printable View
that is the point i canīt help. Nomaly i start the debuger than you se what happends.
I is only math, you need to find the right calculation.
Stefan
Thanks Stefan. I'll battle on. I have one more question.
Using your little motor testing code, it takes 2355 to make the rose go around 360deg. Does this mean that there is 2355 steps in 360degs? If so, it changes the code I'm working on drastically.
Here's my code to turn the rose 360 just so you're clear on what I mean.
FsbusWriteFmtVar(30,80,0);
FsbusMux(2000);
FsbusWriteFmtVar(30,80,2355);
FsbusMux(8000);
FsbusWriteFmtVar(30,80,0);
FsbusMux(8000);
Thatīs right
Stefan,
I am getting this error now:
Run-Time Check Failure #2 - Stack around the variable 'buf' was corrupted.
From reading, and if I understand correctly, is this a problem with the dll, or my code.
It seems to be around the ADF needle code. When I tune the ADF, it is ok for a while, then produces this error.
Any idea what it's telling me?
Thanks
David
do you named a variable 'buf' ?
No. I have no variable "buf".
Doing a little research, this type of error seems to indicate that something is being written to the wrong address, or something is not being cleared from that address before more data is being written to the same address.
I'm probably completely off track with my understanding.
David
Ok Thanks.
On Feb. 19 i have a meeting with Dirk and Rob is will that error message to my todo list.
Please count the errors and try to find the situation to generate the error.
Stefan
Will do. I'll try to give you as much info as possible.
So it's around this piece of code
Code:case FS_ADF1RELATIVEBEARING:
printf("Data in: %d\n",val);
ADF1RelNeedleMulti = (1000 * ADF1RelNeedleDeg) / ADF1RelNeedleStep;
ADF1RelDataIn = val + 32780;
if (ADF1RelDataIn >=0)
{
ADF1RelDataIn = (ADF1RelDataIn+1);
}
ADF1RelDataDif = ADF1RelDataIn - ADF1RelDataSave;
ADF1RelNeedleDif = ADF1RelNeedleMulti / ADF1RelDataDif;
ADF1RelNeedlegoto = ADF1RelNeedleSave + ADF1RelNeedleDif;
FsbusWriteFmtVar(29,80,ADF1RelNeedlegoto/1000);
printf("Relative Bearing %d\n",ADF1RelNeedlegoto/1000);
ADF1RelNeedleSave = ADF1RelNeedlegoto;
ADF1RelDataSave = ADF1RelDataIn;
//printf("ADF1RelNeedleMulti: %d\n",ADF1RelNeedleMulti);
//printf("ADF1RelNeedleDeg: %d\n",ADF1RelNeedleDeg);
//printf("ADF1RelNeedleStep: %d\n",ADF1RelNeedleStep);
//printf("ADF1RelDataIn: %d\n",ADF1RelDataIn);
//printf("ADF1RelDataDif: %d\n",ADF1RelDataDif);
//printf("ADF1RelNeedledif: %d\n",ADF1RelNeedlegoto);
break;
This bit in particular:
FsbusWriteFmtVar(29,80,ADF1RelNeedlegoto/1000);
printf("Relative Bearing %d\n",ADF1RelNeedlegoto/1000);
With the /1000, the printf data stays at 0 to 4.
If I delete the /1000 I now get some useful figures, but it triggers the error. The error is produced even if I try /10, /100
Hope that give some useful info.
Let me know what the follow up is of the meeting.
Thanks
David