Results 171 to 180 of 737
Thread: Progamming help with FSBus dll
-
07-21-2009, 06:49 AM #171
Re: Progamming help with FSBus dll
Other than the obvious ones, none of them resemble any of the boards Rob has on his site.
-
07-24-2009, 07:00 AM #172
Re: Progamming help with FSBus dll
Stefan,
Another question regarding the code for MCP.
For the flight director switch, using Rob's code for the switch, he has coded it for a momentary switch ie: push, turns on, push again, turns off etc.
How do I change this to be a toggle as it should be ie: switch in up position, ON, switch in down position, OFF (I'm sure you understand what I mean).
Here is the code he has:
Code:case C_SFLIGHTDIRL: if (val == 0) { printf("C_SFLIGHTDIRL event, ValFlightDir=%d\n", ValFlightDir); if (ValFlightDir == 0) { // printf("DIRL0, val=%d\n", val); FsbusWrite(C_LFLIGHTDIRL, 1); FsbusWrite(C_LMASTFLIGHTL, 1); FsbusWrite(C_LFLIGHTDIRR, 0); FsbusWrite(C_LMASTFLIGHTR, 0); FsWrite(FS_FLIGHTDIRECTOR,1); ValFlightDir = 1; } elseif (ValFlightDir == 1) { // printf("DIRL1, val=%d\n", val); FsbusWrite(C_LFLIGHTDIRL, 0); FsbusWrite(C_LMASTFLIGHTL, 0); FsWrite(FS_FLIGHTDIRECTOR, 0); FsbusWrite(C_LMASTFLIGHTR, 0); ValFlightDir = 0; } elseif (ValFlightDir == 2) { // printf("DIRL2, val=%d\n", val); FsbusWrite(C_LFLIGHTDIRL, 1); FsbusWrite(C_LMASTFLIGHTL, 0); FsWrite(FS_FLIGHTDIRECTOR, 1); ValFlightDir = 4; } elseif (ValFlightDir == 3) { // printf("DIRL3, val=%d\n", val); FsbusWrite(C_LFLIGHTDIRL, 0); FsbusWrite(C_LMASTFLIGHTL, 0); FsbusWrite(C_LMASTFLIGHTR, 1); FsWrite(FS_FLIGHTDIRECTOR, 1); ValFlightDir = 2; } elseif (ValFlightDir == 4) { // printf("DIRL4, val=%d\n", val); FsbusWrite(C_LFLIGHTDIRL, 0); FsbusWrite(C_LMASTFLIGHTL, 0); ValFlightDir = 2; } } break;
David
-
07-24-2009, 07:34 AM #173
- Join Date
- Feb 2008
- Location
- Krefeld, Germany
- Posts
- 318
Re: Progamming help with FSBus dll
Hi,
do you need the Logic from the 737 with Left and Right FD, Master and FD Light???
Please discribe what you have build as hardware and what funktion do you need?
Stefan
-
07-24-2009, 08:14 AM #174
Re: Progamming help with FSBus dll
I have custom designed my mcp as it is only a single seater cockpit. So there is only one FD switch, I'll describe from left to right (it's loosely based on a 777).
Course Rotary - Course Display
F/D toggle switch
Auto-throttle arm toggle - A/T led indicator
Speed hold momentary
IAS/MACH Display - IAS rotary - IAS/MACH selector momentary
Heading Select momentary / Heading Select Rotary /Heading selectDisplay
Nav momentary / VOR loc momentary / App momentary
Altitude Rotary - Altitude Display - Altitude hold momentary
V/S Display - V/S Hold - V/S Rotary
A/P CMD momentary
A/P Disengage (self centering toggle switch)
I've also attached a 737 mcp image that I've made changes to to give you an idea of what I've done.
Thanks
David
-
07-24-2009, 08:19 AM #175
- Join Date
- Feb 2008
- Location
- Krefeld, Germany
- Posts
- 318
Re: Progamming help with FSBus dll
ok, i only mean the FD Funktion but ok.
Code:case C_SFLIGHTDIRL: if (val == 0) //here you write if 1 active or 0 { // printf("DIRL0, val=%d\n", val); FsbusWrite(C_LFLIGHTDIRL, 1); FsbusWrite(C_LMASTFLIGHTL, 1); FsWrite(FS_FLIGHTDIRECTOR,1); } else { // printf("DIRL1, val=%d\n", val); FsbusWrite(C_LFLIGHTDIRL, 0); FsbusWrite(C_LMASTFLIGHTL, 0); FsWrite(FS_FLIGHTDIRECTOR, 0); } break;
-
07-24-2009, 08:29 AM #176
Re: Progamming help with FSBus dll
ok, i only mean the FD Funktion but ok.
Thank you, thank you, thank you for your help again!!
Very much appreciated.
David
-
08-28-2009, 10:26 PM #177
Re: Progamming help with FSBus dll
Stefan,
I have another question or rather asking your advice.
I have almost finished wiring up the MCP in which I have made another DIO and display 6pack.
So, my question.
I have designed and made my own Korry replicas and I have an amber light in the bottom half to indicate the switch is active, and I have a green led in the top half to light up the legend ie: APP, HDG SEL etc.
I want the green legend leds to light up when the Master Avionics switch is on.
Do I use the 0x3103 offset (which is the one I've used for the Switch)?
There are 8 green leds that I want to light using the digital out on the DIO board, so how do I write that same value to 8 different addresses.
void cbIndicatorlightsBuildObjects()
{
MkFsbusObject(BTP_D_OUT, C_LEDMCPLEGEND1,"MCP Legend LED",cbIndicatorlights,27,11);
MkFsbusObject(BTP_D_OUT, C_LEDMCPLEGEND2,"MCP Legend LED",cbIndicatorlights,27,12);
MkFsbusObject(BTP_D_OUT, C_LEDMCPLEGEND3,"MCP Legend LED",cbIndicatorlights,27,13);
MkFsbusObject(BTP_D_OUT, C_LEDMCPLEGEND4,"MCP Legend LED",cbIndicatorlights,27,14);
etc>>> to 8
MkFsObject(FS_AVIONICS,"",cbSwitches,0x3103,1,TP_I8,FS_NORMAL);
}
void cbIndicatorlights (int oid, int val, double dval)
{
switch (oid)
{
case FS_AVIONICS:
FsbusWrite (C_LEDMCPLEGEND1, val);
FsbusWrite (C_LEDMCPLEGEND2, val);
FsbusWrite (C_LEDMCPLEGEND3, val);
FsbusWrite (C_LEDMCPLEGEND4, val);
FsbusWrite (C_LEDMCPLEGEND5, val);
UP TO 8
break;
Will this do the job.
Thanks
David
-
08-30-2009, 04:11 AM #178
- Join Date
- Feb 2008
- Location
- Krefeld, Germany
- Posts
- 318
Re: Progamming help with FSBus dll
Hi,
the way is right.
Do that work or do you have problems?
I see that FS_AVIONICS you refary to cbSwitches but you use it in cbIndicatorlights. That can be a problem. Maybe you try a global Eventhandler, than you dont have such problems.
Stefan
-
08-30-2009, 05:07 AM #179
Re: Progamming help with FSBus dll
HI Stefan,
Go to hear from you.
Yes it does work this way.
Yes I did have a problem with declaring FS_AVIONICS twice so I moved the code into the Indicatorlights Group and all is good.
Thanks
I'm still not sure how to do the global Eventhandler though, this would have been a simpler solution to keep all the relevant code in the relevant files.
Regards
David
-
10-09-2009, 06:13 AM #180
Re: Progamming help with FSBus dll
Hi Stefan,
I have a little problem I'm hoping you can help me with.
It's been a little while since I've been able to do any work on the sim.
The other day, I finally connected the ADF and Exponder displays up permanently and fired up the sim.
Strange things are happening. As you know, I have built the code up bit by bit and it has worked all the way through.
Here is what is happening:
Some switches are not working (even though they work in FSAdmin)
The servos are doing strange things (although the do follow the software gauges most of the time)
The voltmeters are doing their own thing
The displays will not display correctly (they test fine in FSADmin), they will not display what is on the screen, although the rotaries are changing the setting on the screen and on the display (not the same though), and the decimal point is missing (works in FSAdmin) then the servos in the gauges move rapidly and the displays go out. If I turn the rotaries, the displays light up again (incorrectly) and then the servos move rapidly and the displays go out.
The push button on the rotaries are not working either (they do in FSAdmin).
So, as you can see, there is a lot of things not working how they used to or should. Nothing has changed apart from time.
What can you suggest. Have you had this happen before.
Appreciate you help.
Thanks
David
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
13yo GIRLS FILE DOWNLOADS KIDS PACK DOWNLOAD WEBSITE: OPEN IN AN ANONYMOUS BROWSER (the link does...
5.Sharing an Essay about PIC16F877