Results 221 to 230 of 737
Thread: Progamming help with FSBus dll
-
12-17-2009, 02:00 AM #221
Re: Progamming help with FSBus dll
Yep your right it does work i got it to work with my COM1 display
-
12-17-2009, 02:13 PM #222
- Join Date
- Feb 2008
- Location
- Krefeld, Germany
- Posts
- 318
Re: Progamming help with FSBus dll
Now broadcast the comand (CID 0) and all Displays will react.
Stefan
-
12-17-2009, 10:47 PM #223
Re: Progamming help with FSBus dll
thats what im doing and it works great. Now every thing will turn off when the power to them turns off.
-
12-18-2009, 02:45 AM #224
Re: Progamming help with FSBus dll
Can you show me how you did this.
When I turn my master avionics switch off, in the software, all the radio stack go out, by my actual radio stack stays lit.
I'd like to also do this with my battery switch, when I turn the battery switch off in the cockpit, all the gauges ie: fuel, oil pump, fuel pump etc all turn off on the screen, but in my cockpit, the air core gauges do not turn off as they should.
Appreciate the help from all as always.
David
-
12-18-2009, 12:48 PM #225
- Join Date
- Feb 2008
- Location
- Krefeld, Germany
- Posts
- 318
Re: Progamming help with FSBus dll
Here you have my function.
Code:MkFsObject(FS_BUSVOLT,"", EventHandler, 0x2834, 8, TP_DBL, FS_NORMAL) case FS_BUSVOLT: // send the voltage information as a percent value // to all controllers with command 131. int spannung = (val * 100 / 24); if (spannung != SpannungSave) { FsbusWriteFmt3 (0, 131,spannung); SpannungSave=spannung; } break;
Stefan
-
12-18-2009, 01:35 PM #226
Re: Progamming help with FSBus dll
in my .CPP i put this but this is the Offset for the Avionics but you can change it to the main Battery one if you want
Code:#include "stdafx.h" void BuildRadiostackObjects () { MkFsObject(FS_BUSVOLT, "BUSVOLTS", cbBusvolt, 0x2850, 8, TP_I64, FS_QUICK); } void cbBusvolt (int oid, int val, double dval) { switch (oid) { case FS_BUSVOLT: FsbusWriteFmt3 (0, 131, val * 100 / 24 ); } }
-
12-18-2009, 05:45 PM #227
Re: Progamming help with FSBus dll
Thanks guys, I'll put it in the code and see how it goes.
I'll let you know.
David
-
12-21-2009, 07:55 AM #228
Re: Progamming help with FSBus dll
Finally got the time to test out the code.
Here what is happening.
When I start FSX, the displays (in my cockpit) are lit even though the cockpit is cold and dark in the software (there must be a syncronize command somewhere to add in).
As I go through the start up sequence, I turn the avionics on and the displays start flashing on and off.
When I start the engine, the displays go out.
When I stop the engine, displays start flashing again.
When I turn the avionics switch off, displays go off (this part is working well)
Any ideas on what I need to tweak?
Do you want me to post the code from the .cpp file this code is in?
Ah, I'd do it anyway:
Code:#include "stdafx.h" void cbVoltmetersBuildObjects() { MkFsbusObject (BTP_A_OUT,C_FUELLEFT,"Left Fuel Gauge",cbVoltmeters,27,86); MkFsbusObject (BTP_A_OUT,C_FUELRIGHT,"Right Fuel Gauge",cbVoltmeters,27,84); MkFsbusObject (BTP_A_OUT,C_OILPRESSURE,"Oil Pressure Gauges",cbVoltmeters,27,87); MkFsbusObject (BTP_A_OUT,C_OILTEMP,"Oil Temp Gauges",cbVoltmeters,27,85); MkFsbusObject (BTP_A_OUT,C_MAINBUSAMPS,"Main Bus Amp Gauge",cbVoltmeters,27,83); MkFsbusObject (BTP_A_OUT,C_FUELPRESSURE,"Fuel Pressure Gauge",cbVoltmeters,27,82); MkFsObject(FS_FUELLEFTMAINLEVEL,"Left Fuel Gauge",cbVoltmeters, 0x0B7C,4,TP_I32, FS_NORMAL); MkFsObject(FS_FUELRIGHTMAINLEVEL,"Right Fuel Gauge",cbVoltmeters, 0x0B94,4,TP_I32, FS_NORMAL); MkFsObject(FS_GENERALENGINE1OILPRESSURE,"Oil Pressure Gauge",cbVoltmeters,0x3B60,8,TP_DBL,FS_NORMAL); MkFsObject(FS_ENGINE1OILTEMP,"Engine Oil Temp Gauge",cbVoltmeters,0x08B8,2,TP_I16,FS_NORMAL); MkFsObject(FS_MAINBUSAMPS,"Main Bus amp Gauge",cbVoltmeters,0x282C,8,TP_DBL,FS_NORMAL); MkFsObject(FS_FUELPRESSURE,"Fuel Pressure Gauge",cbVoltmeters,0x3868,8,TP_DBL,FS_NORMAL); MkFsObject(FS_BUSVOLT, "BUSVOLTS", cbVoltmeters, 0x2850, 8, TP_I64, FS_QUICK); } void cbVoltmeters (int oid, int val, double dval) { switch (oid) { case FS_GENERALENGINE1OILPRESSURE: { val=(val / 41); static CALTAB OILPRESSUREGauge[] = { {0,255},{127,200},{255,0} }; val = Calibrate (val, OILPRESSUREGauge,3); FsbusWrite (C_OILPRESSURE, val); } break; case FS_FUELLEFTMAINLEVEL: { static CALTAB FUELLEFTMAINGauge[] = { {0,255},{4194304,155},{8388608,0} }; val = Calibrate (val, FUELLEFTMAINGauge,3); FsbusWrite (C_FUELLEFT, val); } break; case FS_FUELRIGHTMAINLEVEL: { static CALTAB FUELRIGHTMAINGauge[] = { {0,255},{4194304,155},{8388608,0} }; val = Calibrate (val, FUELRIGHTMAINGauge,3); FsbusWrite (C_FUELRIGHT, val); } break; case FS_ENGINE1OILTEMP: { static CALTAB OILTEMPGauge[] = { {0,255},{25000,0} }; val = Calibrate (val, OILTEMPGauge,2); FsbusWrite (C_OILTEMP, val); } break; case FS_MAINBUSAMPS: { static CALTAB MAINBUSAMPSGauge[] = { {-60,255},{0,177},{60,0} }; val = Calibrate (val, MAINBUSAMPSGauge,3); FsbusWrite (C_MAINBUSAMPS, val); } break; case FS_FUELPRESSURE: { static CALTAB FUELPRESSUREGauge[] = { {0,255},{10,230},{16,200},{40,0} }; val = Calibrate (val, FUELPRESSUREGauge,4); FsbusWrite (C_FUELPRESSURE, val); } break; case FS_BUSVOLT: { FsbusWriteFmt3 (0, 131, val * 100 / 24 ); } } }
David
-
12-21-2009, 03:02 PM #229
Re: Progamming help with FSBus dll
I dont see any Displays in your code what Displays are you talking about?
Trevor
-
12-21-2009, 05:38 PM #230
Re: Progamming help with FSBus dll
Hi Trevor,
I've only copied the code for the voltmeters.cpp
The code for the displays are in various other relevant .cpp files
The displays I have programmed are:
Nav1 & Nav1 stby
ADF
XPNDR
MCP
all 7 seg led displays.
The code for most of it is in this thread as Stefan has helped me with just about all of it.
Another thing, if I turn the master battery switch off, the 7seg displays also go out as they should.
So I just can't get them to stay lit (stop flashing) when everything is turned on and engine not running and to stay lit (not turn off) when engine is started.
Hope I'm explaining myself clearly.
Thanks
David
PS. I'm going to try Stefan's code for this later today and see how that goes.
Code:MkFsObject(FS_BUSVOLT,"", cbVoltmeters, 0x2834, 8, TP_DBL, FS_NORMAL) case FS_BUSVOLT: // send the voltage information as a percent value // to all controllers with command 131. int voltage = (val * 100 / 24); if (voltage != VoltageSave) { FsbusWriteFmt3 (0, 131,voltage); VoltageSave=voltage; } break;
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