Results 621 to 630 of 737
Thread: Progamming help with FSBus dll
-
02-06-2011, 04:58 PM #621
- Join Date
- Feb 2008
- Location
- Krefeld, Germany
- Posts
- 318
Re: Progamming help with FSBus dll
ok, i will be there.
-
02-08-2011, 08:35 AM #622
- Join Date
- Feb 2008
- Location
- Krefeld, Germany
- Posts
- 318
Re: Progamming help with FSBus dll
David,
if you finished the code please post them.
The version here has the 2 bugs.
Stefan
-
02-08-2011, 08:59 AM #623
Re: Progamming help with FSBus dll
Hi Stefan,
Thank you again for your time.
I'll post the code as it stands now.
I checked the number of steps in 360 deg and now have 1150. I have adjusted the code accordingly. The needle is still moving much further than the needle in FSX, so I may need to divide the final output to get the right number of steps.
Also, how does this gauges sync with FSX?
Code:static int ADF1RelDataIn; static int ADF1RelDataSave; static int ADF1RelDataDif; static int ADF1RelNeedlegoto; static int ADF1RelNeedleSave; static int ADF1RelNeedleDif; float ADF1RelNeedleMulti; //static int ADF1RelNeedleMulti; static int ADF1RelNeedleDeg = 360; //static int ADF1RelNeedleStep = 2355; static int ADF1RelNeedleStep = 1150; case FS_ADF1RELATIVEBEARING: printf("Data in: %d\n",val); ADF1RelNeedleMulti = ADF1RelNeedleStep/ADF1RelNeedleDeg; //ADF1RelNeedleMulti = ADF1RelNeedleDeg / ADF1RelNeedleStep; //ADF1RelNeedleMulti = ADF1RelNeedleDeg) / ADF1RelNeedleStep; ADF1RelDataIn = val + 32780; if (ADF1RelDataIn >=0) { ADF1RelDataIn = (ADF1RelDataIn+1); } ADF1RelDataDif = ADF1RelDataIn - ADF1RelDataSave; ADF1RelNeedleDif = ADF1RelDataDif / ADF1RelNeedleMulti; ADF1RelNeedlegoto = ADF1RelNeedleSave + ADF1RelNeedleDif; FsbusWriteFmtVar(29,80,ADF1RelNeedlegoto); printf("Relative Bearing: %d NeedleDif: %d NeedleSave: %d\n",ADF1RelNeedlegoto, ADF1RelNeedleDif, ADF1RelNeedleSave); 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;
-
02-08-2011, 09:29 AM #624
- Join Date
- Feb 2008
- Location
- Krefeld, Germany
- Posts
- 318
Re: Progamming help with FSBus dll
The needle is still moving much further than the needle in FSX, so I may need to divide the final output to get the right number of steps.
You can also change float ADF1RelNeedleMulti; to static int ADF1RelNeedleMulti;.
-
02-08-2011, 09:37 AM #625
Re: Progamming help with FSBus dll
I am getting an error message on compiling.
I'm not in front of my FSX computer, but it is something about converting int to double (or the other way around) and some data may be lost.
The difference does seem to be consistent.
What changes will occur changing the float bact to a static int?
Thanks
-
02-08-2011, 09:40 AM #626
Re: Progamming help with FSBus dll
I would be substracting from the FsbusWriteFmtVar(29,80,ADF1RelNeedlegoto); line.
So could I write something like this just as an example:
FsbusWriteFmtVar(29,80,(ADF1RelNeedlegoto - 100));
-
02-08-2011, 11:10 AM #627
- Join Date
- Feb 2008
- Location
- Krefeld, Germany
- Posts
- 318
Re: Progamming help with FSBus dll
I am getting an error message on compiling.
I'm not in front of my FSX computer, but it is something about converting int to double (or the other way around) and some data may be lost.
The difference does seem to be consistent.
What changes will occur changing the float bact to a static int?
Thanks
Let is as flot, it is ok.
So could I write something like this just as an example:
FsbusWriteFmtVar(29,80,(ADF1RelNeedlegoto - 100));
Stefan
-
02-09-2011, 02:17 AM #628
- Join Date
- Mar 2009
- Location
- South Africa
- Posts
- 221
Re: Progamming help with FSBus dll
Ok i have a problem - the same that has always plagued me. I had modified 12way rotary switches for "encoders" and they worked well. BUT - what i found was that from time to time i would turn them and then suddenly they "lost" their settings and just increased the value either way it was turned so i had to go into FSBUS and digital IN settings and reset it to be a 4 tep or whatever.
I got a prompt from Stefan to change the BO bits which i did to 4v. Then i also bought some proper encoders which work GREAT! and they are smooth and are absolutely fantastic. BUT - here is the problem again!!
I will be using my MCP and it works like a charm but then at some stage i will start to change the CRS once i know which runway i will be using and i start turning the encoder then what happens - while i turn it it seems the digits "stick" and then eventually stop changing and then i have to go into FSBUS again Digital IN and set it again to an encoder!!
This happens almost all the time. SO i thought my problem was sorted and spent more money (not a problem as it is better) but my problem remains and i have to keep resetting the rotaries so they act properly.
I don't want to even think about having to constantly reset my switches etc so they work each time i want to fly.
I have even re flashed the 8535 and set the bits etc a couple of times and doesn't seem to fix this. I am lost!
Sean
-
02-09-2011, 02:26 AM #629
- Join Date
- Feb 2008
- Location
- Krefeld, Germany
- Posts
- 318
Re: Progamming help with FSBus dll
Can you try a new 8535?
-
02-09-2011, 02:34 AM #630
- Join Date
- Mar 2009
- Location
- South Africa
- Posts
- 221
Similar Threads
-
Fsbus CDK
By flyandre in forum General Builder Questions All Aircraft TypesReplies: 4Last Post: 12-27-2014, 12:58 PM -
Need Help Getting My FSBUS NG I/O Going Again..
By JBRoberts in forum I/O Interfacing Hardware and SoftwareReplies: 14Last Post: 03-21-2010, 01:38 PM -
Fsbus ng io
By Davral in forum I/O Interfacing Hardware and SoftwareReplies: 0Last Post: 01-10-2009, 10:38 PM -
Fsbus 2.4.3
By Anderson/SBSP in forum I/O Interfacing Hardware and SoftwareReplies: 9Last Post: 11-30-2008, 04:25 PM -
Help FSBUS
By cesarfsim in forum I/O Interfacing Hardware and SoftwareReplies: 2Last Post: 10-26-2008, 02:23 PM
Beautiful Womans in your town for night
B_34 TOGA takeoff